Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
KNRaju105630
Partner - Contributor II
Partner - Contributor II

Cumulative sum should not change based on selection

Hi Experts,

I'm doing cumulative sum - that is working fine, but if user select any product cumulative value should not be change.

below is my cumulative sum and I'm selecting one product as Tab, here cumulative sum has changed to 10.

Cumulative Sum: RangeSum(Above(TOTAL Sum(Sales), 0, RowNo(TOTAL)))

KNRaju105630_2-1679713211692.png

I did some work around when user select product, finding MIN and MAX value

like Min(Sales) and max({<Product=>}Sales)) - same way applied in set expression

=Sum({<Sales ={">=$(=min(Sales)) <=$(=max({<Product=>}Sales))"}, Product=>}total Sales) - this expression is working fine for one product selection.

KNRaju105630_0-1679714400855.png

 

but my problem is when user select multiple products not working.

my output should be:

if user select single product or Multiple products should not be change the cumulative value (If any sub filter selections cumulative should not change)

 

Thanks in Advance!

 

 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try:

tresesco_0-1679912052398.png

sum(aggr( rangesum( above( total If(Sum({<Product>}Sales)=Above(Total Sum({<Product>}Sales)),0,sum( {<Product>} Sales)),0,RowNo(TOTAL) )),(Product,(=Sum({<Product>} Sales),Desc))))

 

View solution in original post

10 Replies
KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

Experts, any work around backend or UI ?

is there any possibility ?

KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

@tresesco , any suggestion please 

tresesco
MVP
MVP

tresesco_0-1679892444258.png

sum( aggr( rangesum( above( total sum( {<Product>} Sales),0,RowNo(TOTAL)) ),(Product,(=Sum({<Product>} Sales),Desc))))

KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

Thanks for response!

Same expression while applying to here not working - could you please help, how to apply in below expression

IF(Sum(Sales)<>ABOVE(Sum(Sales)), 

RangeSum(Above(Total [Cumulative]), Sum(Sales)),

ABOVE([Cumulative]))

 

tresesco
MVP
MVP

Please share your complete requirement. I have the qvw now, I will try working on that and see if I can help.

KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

below is my table - I'm calculating cumulative based on sorting and below highlighted two columns (if it is same value cumulative value should be the same).

Here I'm facing issue, if user hit any selection - value should not be the change.

Category  Sub Category  Product  Sales  Cumulative
Books Qlik Qlik Sense 30 30
Mobiles Samsung S1 25 55
Mobiles Nokia N1 12 67
Books Tableau Tab 10 77
Mobiles IPhone I++ 9 86
Books Spotfire SF 8 94
Mobiles Samsung S2 7 101
Mobiles Samsung S3 7 101
Books Qlik QlikView 5 106
Mobiles Nikia N2 2 108

 

 

tresesco
MVP
MVP

Try:

tresesco_0-1679912052398.png

sum(aggr( rangesum( above( total If(Sum({<Product>}Sales)=Above(Total Sum({<Product>}Sales)),0,sum( {<Product>} Sales)),0,RowNo(TOTAL) )),(Product,(=Sum({<Product>} Sales),Desc))))

 

KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

Awesome work 🙂 - Thank you

KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

HI @tresesco ,

is there any possibility like below - I have to cumulative group  category level

my output should be like Group Level 

Category Product Amount Cumm Group Level
Books XAB 30 30 30
Books XYZ 30 30 30
Books BCA 30 30 30
Mobiles I+ 30 30 60
Books ABG 30 30 30
Books ABC 30 30 30
Mobiles S1 25 55 85
Mobiles N1 12 67 97
Books Tab 10 77 107
Mobiles I++ 9 86 116
Books SF 8 94 124
Mobiles S2 7 101 131
Mobiles S3 7 101 131
Books QlikView 5 106 136
Mobiles N2 2 108 138

 

Please give suggestion