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

Alteryx Designer Desktop Discussions

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

Need support on calculating total

SCK
8 - Asteroid

Hi All. Apologies if the question is already populated, however, I could not find a suitable response. I need help in calculating grand total which will pull values only from the rows that contains subtotals. I have attached an input and output file. Please help  me.

16 REPLIES 16
ImadZidan
12 - Quasar

Hello @SCK ,

 

Calculating the subtotal will need to be based on a criteria or a group or in other work a break point to tell me when to subtotal

 

Example

 

in your data yo have the below

 name      4  6  6  8
 name1    5  5  7  5
 name 2   8  9  7  9
 subtotal  17 20 20 22   My question is here , how did you decide to subtotal here?
 name 3      2   4   6   7
 name 4    5   7   9  9
 subtotal  7 11 15 16  My question is here , how did you decide to subtotal here?

 

I hope this makes sense. 

 

SCK
8 - Asteroid

Yeah I understand what you are saying here. Is there a way maybe you could generate a blank row in between where i want to subtotal and then put in a condition saying if there is a blank calculate total?

ImadZidan
12 - Quasar

Hello @SCK ,

 

Well you can yes but the question will still stand.  Another thing you can decide to group and create subtotal every 3 rows. Let me give you an example and you will see it first hand.

ImadZidan
12 - Quasar

Hello @SCK ,

 

I have put together a grouping option. 

 

What it does is group the rows in threes and adds a subtotal after that.

 

The way to see it in action is by using your input file but first take out the all the subtotal and total records .

 

Have a look and may be it gives you an idea.

SCK
8 - Asteroid

Thanks for helping out. I managed to pull off the solution by combining different tools and got the result i needed. Your solution actually doubled the actual grand total. For example, if you look into the dummy output the grand total for science should be 24 however, your solution had a grand total of 48. However, thank you for your help, I got to learn some new expressions through this.

ImadZidan
12 - Quasar

Hello @SCK ,

 

brilliant, well done. I was sure we can always work something out.

 

 

SCK
8 - Asteroid

Agreed and thanks again for your help.

Labels
Top Solution Authors