Hello,
I have a table which contain sequenceID , Minutes and Running sum of Minutes.
I want to add a row,
- when Running sum of minutes greater than 20,40,60,80 ... (after each multiples of 20)
How can I do this in Alteryx
Sample data
Seq | Duration(inMins) | RunTot_Duration(inMins) |
1 | 4.522172489 | 4.522172489 |
2 | 1.599680064 | 6.121852553 |
3 | 1.599680064 | 7.721532617 |
4 | 1.599680064 | 9.321212681 |
5 | 1.599680064 | 10.92089274 |
6 | 1.599680064 | 12.52057281 |
7 | 4.814421731 | 17.33499454 |
8 | 3.230123206 | 20.56511775 |
9 | 8.726993063 | 29.29211081 |
10 | 6.15E-02 | 29.35363696 |
11 | 0.953655423 | 30.30729239 |
12 | 0.399920016 | 30.7072124 |
13 | 5.619922169 | 36.32713457 |
14 | 2.953255503 | 39.28039008 |
15 | 3.906910926 | 43.187301 |
16 | 1.553535447 | 44.74083645 |
17 | 1.583333333 | 46.32416978 |
18 | 5.558396013 | 51.88256579 |
19 | 9.721132697 | 61.60369849 |
20 | 1.230523126 | 62.83422162 |
21 | 4.727792903 | 67.56201452 |
22 | 0.215341547 | 67.77735607 |
23 | 1.166666667 | 68.94402273 |
24 | 4.297109809 | 73.24113254 |
25 | 3.681848246 | 76.92298079 |
26 | 3.651085168 | 80.57406596 |
27 | 4.143294418 | 84.71736037 |
Solved! Go to Solution.
Do you want this new row to contain any data or just to be blank?
How I would approach this is to use the tile tool. With this tool there is a configuration to set manual values as your cut offs, so this would be 20,40,60 etc. This will then create two new fields called Tile_Num and Tile_Seq which can later be used to sort your data.
Next you need to create a fake row, so using the summarize tool you can group by Tile_num and get the max for your Tile_seq. Using a formula tool you can increase the max tile sequence value by 1. Unioning this data with your original data and then sorting will insert the blank rows where you want them.
Hi @tjamal1,
I have created a workflow for you.
Output:
If this was helpful please mark my post as an answer!
Thanks, @cgoodman3 for the reply.
The new row should be blank.
Can you provide a workflow based on my data?
Thanks @Emil_Kos for the solution.
Can you attach the workflow?
Hi @tjamal1,
I have also replicated the @cgoodman3 as this sounds very interesting for me.
You will have both approaches in the workflow:
If you could please mark both my post and @cgoodman3 as well. I have learned something interesting thanks to his post 🙂
How do we do this for Text values?
Sample Data
House | Directions |
House 1 | North |
House 1 | West |
House 1 | East |
House 1 | South |
House 2 | West |
House 2 | East |
House 2 | South |
House 3 | North |
House 3 | West |
Output Data
For every House, all the missing Directions also needs to be included
House | Directions |
House 1 | North |
House 1 | West |
House 1 | East |
House 1 | South |
House 2 | North |
House 2 | West |
House 2 | East |
House 2 | South |
House 3 | North |
House 3 | West |
House 3 | East |
House 3 | South |
House 4 | North |
House 4 | West |
House 4 | East |
House 4 | South |
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |