Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Cumulative sum based on the multiple id.

sriniprad08
11 - Bolide

Hi Team,

 

Hope you are well. I need help. 

I need to sum the values of a column based on the id. Final output column is marked in yellow.

 

Thanks ,

 

Sri

 

 

 

 

 

 

 
 
 

 

 

16 REPLIES 16
geraldo
13 - Pulsar

@sriniprad08 

 


it will always be on 2 lines.
it would be ideal for you to send an example with more sample data

sriniprad08
11 - Bolide

@geraldo  : Thank you . Just attached the sample data.

caltang
17 - Castor
17 - Castor

Hi @sriniprad08 - we need more information. Because based on what you provided, I can only assume that it will always be for the Max line of the 2nd column, and the sum of values of the first column - all provided by the Group of ID. Since this is just an assumption, the workflow I have here may not account for all your needs - please be mindful of this.

 

Screenshot 2023-06-29 221642.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
sriniprad08
11 - Bolide

Hi @caltang ,

 

Thank you for the solution. Appreciate it. I have attached the updated data.

Please let me know if this looks ok.

 

caltang
17 - Castor
17 - Castor

Hi @sriniprad08

 

I’ve already attached the workflow for you - replace the text input with your new data and run it. You should get the result you desire. 

If not, you can add a RecordID from the start and to the end, and join back using a Join Tool to get your desired output.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
sriniprad08
11 - Bolide

Hi @caltang ,

 

Thank you.I tried with the  but its giving different results.

sorry may be i am missing something. Do i need to add record id at the end of the flow?

 

Cheers,

Sri

 

caltang
17 - Castor
17 - Castor

Yes, you just need to add a RecordID Tool immediately after the Input Tool. 

Then, in the Summarize tool, you need to add the Max RecordID, and you will be able to have your values towards the end. 

Once done, you can perform a Left Outer Join with the main data on the left and the new rows of data on the right. (Join Tool + Union Tool). 

I am currently going to bed soon, try this on your own and you should be able to get it. Otherwise I can help you out tomorrow. 

thanks,

Calvin

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
geraldo
13 - Pulsar

@sriniprad08 

 

Other example

 

calculate.JPG

sriniprad08
11 - Bolide

Hi @geraldo ,

Perfect. Thank you. Great one challenge sorry which i forgot to mention.

There is another column called sub_num. So the flow as to take into consideration num and sub_num.

 

Please find attached and let me know how to go about it,

 

Cheers,

Sri

Labels