Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding Subtotals to output after going through Summarize and Crosstab tools.

knobsdog
8 - Asteroid

I need to take data I've run through a summarize and crosstab to get nested rows but on those rows I need a summary subtotal going across the row.  I've attached an example workflow with fake data since my data is sensitive.  It matches the kind of thing I'm looking to do perfectly down to the columns/rows nested summary etc. 

 

Also is there a way to show the items without an Update Date, showing as null, to the bottom of each section, ie CS, DiPC, etc?

 

Can anyone figure out how to do this?

 

 
 

Workflow Pic.png

12 REPLIES 12
phottovy
13 - Pulsar
13 - Pulsar

I didn't quite get the same numbers as your example but try this workflow. I added several tools directly after your first summarize tool.

phottovy
13 - Pulsar
13 - Pulsar

@knobsdogI just reread your original description. Here are two slightly modified workflows. Hopefully one of them gets you close to your desired table but let me know if I am still not fully understanding your question.

knobsdog
8 - Asteroid

I will take a look.  Thank you for the quick response.

knobsdog
8 - Asteroid

V2 is exactly what I was looking to do.  Thank you so much for your help.

 

knobsdog
8 - Asteroid

Now that I've adjusted your workflow to my actual data I'm noticing there's no grand total.  There's a subtotal for each division but I can't seem to get it to show the complete total for all divisions without it showing twice.  Any ideas?

 

phottovy
13 - Pulsar
13 - Pulsar

You can easily add a grand total by using a Summarize tool followed by a Union tool. I added the changes to the attached workflow.

knobsdog
8 - Asteroid

Sorry for the delayed response.  I just looked through your solution but it's not quite right.  It's totaling everything in the column including the subtotals so it's actually double counting everything.  This is so close to what I'm looking for but I need to basically just total either the column amounts minus the subtotals or just total the subtotals without the rest of the items in the column.

phottovy
13 - Pulsar
13 - Pulsar

@knobsdogYou are correct, I didn't account for that. There are two quick ways I can think of to fix this. First is add a filter before I calculate the grand total (V2 attached) or calculate the grand total in the same step that I originally calculated the subtotals (V3 attached)

knobsdog
8 - Asteroid

V3 works great, thank you so much for your help and quick reply.

Labels
Top Solution Authors