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.

Subtotal of each section of data given in a column.

shivama429
6 - Meteoroid

Hello All,

 

I have been provided with a data wherein I have zones(north, south, east and west) in one column and in another columns I have states falling under each zone and in 3rd column I have numeric data for each state, now I need to insert a row every after the zone which to reflect total of each zone.

 

Can someone please help!!

6 REPLIES 6
mbarone
16 - Nebula
16 - Nebula

I would summarize (group by, sum) then join back to the original feed.

echuong1
Alteryx Alumni (Retired)

The easiest way to achieve this is by using a summarize to get the total for each zone. I used a formula to add in a label for the state field - I made it "zz_Total" so that I could use this later on to sort by the state field and always have the total as the last row. I then used a union to append the original data and the total together, and a sort to get the correct order. I then used a formula to remove the "zz_" from the total label.

 

echuong1_0-1608754997340.png

 

shivama429
6 - Meteoroid

Screenshot_20201224-014828.jpg

 

Consider this as a scenario and every after a zone I need to add a row which will sumup the amount collected by each zone

echuong1
Alteryx Alumni (Retired)

Updated with your sample data. Hope this helps!

 

echuong1_0-1608755342829.png

 

shivama429
6 - Meteoroid

HI, 

 

Thank you for your help, just one more help....

 

Is it possible that instead of "Total" text can it come as a combination of Zone and then Total. For eg. for total of East zone text should be written as East_Total.

 

And instead of using Select tool to do it manually, is there a way to do it with some formula or tool?

 

Regards,

Shivam Arora

pedrodrfaria
13 - Pulsar

Hi @shivama429 

 

I have attached the example above with the additional help you were looking for. You can use the Formula Tool to create string functions and create these fields with the desired names.

pedrodrfaria_1-1609120236530.png

pedrodrfaria_2-1609120357828.png

 

Pedro.

 

 

Labels