Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
SamKng
Contributor II
Contributor II

Sum on Max per dimension

Dear all,

I have the feeling that the solution for my problem should be very easy, I however did not find any solution in several related threads yet.

Please have a look at the following data:

screenshot.jpg

What I'd like to see is:

- Yield per Order and Operation in each row

- Sum of Max(Yield) per Order in the total row

The above simple approach basically suits to my needs, however with one important exception: the 0 in the second row  should be 500 and the 0 in row 4 should be 1000. 

I hope my explanations are clear, otherwise let me know.

Any input is highly appreciated. 

Best regards, jovie

 

 
1 Solution

Accepted Solutions
Kushal_Chawda

try this

=if(sum(aggr(max(Yield),Order))=0,sum(Yield),sum(aggr(max(Yield),Order)))

View solution in original post

7 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

how about sum(aggr(max(Yield),Order,Operation))

Kushal_Chawda

Looks like both Yield and Max Yield gives same output. Can you please elaborate more?

SamKng
Contributor II
Contributor II
Author

Thanks for your idea. That helps for the rows, but the the total is then wrong:screenshot1.jpg

 

The total should show the sum of the max per order (accross operations), which means:

Max of order A: 1'500

Max of order B: 2'000

---------------------------

Sum of both: 3'500

 

Any other ideas?

 
jochem_zw
Partner Ambassador
Partner Ambassador

sum(distinct aggr(Max(Total <Order> Yield),Order,Operation))

SamKng
Contributor II
Contributor II
Author

Thanks for this new idea. The result is a bit closer to what I need, but not 100% there yet:

2020-01-20_153807.jpg

 

 

Kushal_Chawda

try this

=if(sum(aggr(max(Yield),Order))=0,sum(Yield),sum(aggr(max(Yield),Order)))
SamKng
Contributor II
Contributor II
Author

Clever, that works, thanks a lot! 🙂