Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Grand Total and Sub Totals

CarlMz
6 - Meteoroid

HI,

 

I am struggling to calculate the Grand Total and Sub Totals for the table i have.]

 

DeptSub DeptSalesCostMfgProfit
MKTMKT _ US100101080
MKTMKT_CAN2001001575
ProdProd_US10226
ProdProd_CAN502244

 

I need a subtotal after each Dept , so one after MKT and one after Prod and than one final Grand Total. WHat would be easiest way to achieve this.

 

C

7 REPLIES 7
Kenda
16 - Nebula
16 - Nebula

Hey @CarlMz! I would use a Summarize tool to GroupBy Dept then Summing the rest of the fields. Then, to add a Grand Total row, you could add another Summarize tool that is just the Sum of all of the summed fields. You can then use a Union to append it to your original data set. See the attached v11.0 workflow. Hope this helps!

JoshKushner
12 - Quasar

You can use the summarize tool to find sub and grand totals in your data. 

 

Flow:

Flow.PNG

 

Sub Total:

subtotal tool.PNG

subtotal.PNG

 

Grand Total:

total tool.PNG

Total.PNG

 

JoshKushner
12 - Quasar

Totally love how @BarnesK added the total rows to the table. It's a perfect format for document rendering

 

Flow:

table.PNG

 

Table:

table browse.PNG

 

Table Tool:

table tool.PNG

 

Table Styling:

styling.PNG

 

CarlMz
6 - Meteoroid

Thank you all for the detail breakdown. I really appreciate your help and talking the time out to help me as i learn this amazing tool.

 

C

Inactive User
Not applicable

Hi @joshkushner can you please provide me Workflow? i tried the same way as in Screenshot but i couldnt able to get the desired result.

Gina2021
8 - Asteroid

Thanks tons @Kenda ! I just used this.

gregx
8 - Asteroid

@JoshKushner a bit old topic, but I believe people should be aware that the solution is incorrect.

It does work, but only on very specific data e.g. assuming the categories are very different to each other or assuming that everyone want it in ascending order.

Adding a word " Total" doesn't guarantee putting the total row on the last position.

e.g.

You have categories "MKT" and "MKT Taco".

After adding " total"  and sorting you get: "MKT", "MKT Taco", "MKT Taco Total", "MKT Total" (WRONG ORDER!)

 

Also there are other things that can spoil this approach like : we want categories to be in descending order, but Totals on the bottom etc.

 

concluding, this is wrong.

Labels