Qlik Community

Ask a Question

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik Users, make your voice heard! Participate in Wisdom of Crowds® Market Study: Start Survey
cancel
Showing results for 
Search instead for 
Did you mean: 
jovie
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

 

 
Labels (1)
1 Solution

Accepted Solutions
Kush
MVP
MVP

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
Partner

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

Kush
MVP
MVP

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

jovie
Contributor II
Contributor II

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
Partner

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

jovie
Contributor II
Contributor II

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

 

 

Kush
MVP
MVP

try this

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

View solution in original post

jovie
Contributor II
Contributor II

Clever, that works, thanks a lot! 🙂