Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to get Cumulative % to totals

PrathameshMDLZ
5 - Atom

I have complex large size data sets comprizng many months that I arrvied at following subset with one avg. column averaging all months.

Now I want to run by country cumulative % contribution of each material in data set. something like below, (column in bold font is what I wish to achieve)

all other calculated columns are done...

 

done with sorting and adding running totals with row id function added. Now want to achieve Country wise total and then add Cumulative % field added to it.. Any help appreciated. Since data set is large, avg. execution time is around 30 min... so any experiment require me to wait for 30 min for each attempt... is there a way to execute part of the flow only ?

 

 

CountryMaterialVolCum TotalCountry TotalCum %
CH000612512519963%
CH00054917419987%
CH000425199199100%
CN0009700700140050%
CN00085001200140086%
CN000720014001400100%
US000310910924844%
US00028919824880%
US000150248248100%
5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @PrathameshMDLZ ,

 

Here is a workflow for the task.

 

Input:

atcodedog05_1-1602681105804.png

 

Output:

atcodedog05_0-1602681090237.png

Workflow:

atcodedog05_2-1602681122658.png

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

estherb47
15 - Aurora
15 - Aurora

Hi @PrathameshMDLZ 

 

For a smaller data set, use the Sample tool to sample out a handful of records for testing. 100, 200, whatever works for you

 

A Summarize tool will get you the maximum Cum Total for each Country. Group on Country, use Max for the 
Cum Total, and create the column for Country Total. Join that back to your original data on Country field.

 

You can then use a formula tool to calculate percentage of Cumulative total.

 

Let me know if that helps.

 

Cheers!

Esther

danilang
19 - Altair
19 - Altair

Hi @PrathameshMDLZ 

 

You can use the cache and run(C&R) workflow option near the end of your workflow to help you test out options.  C&R runs the workflow up to that point and saves the results to a temporary file.  Any time you run from then on, the input is read from the cache reducing the run time from 30 mins to seconds.  

 

To use C&R, right click on a tool near the end of your workflow and select the "Cache and Run Workflow" option.

car.png

 

There are a few conditions the the tool has to meet to have the C&R option enabled

1. The tool can only have 1 output anchor

2. The tool can't be inside a split stream.  A split stream is when a data flow is split in two and the two parts are rejoined further on.  The tools inside the green box above are inside a split stream that is started by the Join at the upper left and ended at the Union tool where #1 and #2 streams come together.  In this case, the C&R option on the select highlighted in blue is grayed out.

 

Another thing to note is that the cached data is only available while the workflow is open in Designer.  If you close either the workflow or Designer itself, you'll have to cache the data again the nest time you open the workflow

 

Dan

 

 

PrathameshMDLZ
5 - Atom

This worked perfectly.... thanks for quick and simple solve...  🙂 millions of records so experimentation was difficult....

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @PrathameshMDLZ 

 

Cheers and Happy Analyzing 😀

Labels