Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Cumulative Sum Help!

Hi Folks,

I need to cumulative sum on bar chart , below is my expression:

=num(Money(sum(aggr(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), CurrencyIsoCode, Month))/1000000),'####')

I'm trying Something like below , but it's not working:

=aggr( rangesum(above( sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), 0, rowno() )), CurrencyIsoCode, Month)

Thanks,

AS

Labels (1)
23 Replies
sunny_talwar
MVP
MVP

What expression are you using to get this current scenario chart?

amit_saini
Master III
Master III
Author

I'm sorry you are right:

Expression is :

=num(Money(sum(aggr(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), UP2GO_2F__pkl_ProductStatus__c, Month))/1000000),'####')

Thanks

AS

sunny_talwar
MVP
MVP

Using that expression, I get this chart

Capture.PNG

But this is not the same as the one you have currently

amit_saini
Master III
Master III
Author

Please select below option:

In my attachment by mistake I have selected "Accumulate".

Thanks,

AS 

amit_saini
Master III
Master III
Author

Attached is correct sample.

Kushal_Chawda
MVP
MVP

take month as dimension and below expression

=rangesum(aggr(above( sum( aggr(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), CurrencyIsoCode, Month))/1000000,0,RowNo()),Month))

Kushal_Chawda
MVP
MVP

see this

Dimension: month

Expression:

rangesum(aggr(above( sum( aggr(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), CurrencyIsoCode, Month))/1000000,0,RowNo()),Month))

Capture.JPG

amit_saini
Master III
Master III
Author

This I can achieve by simply selecting below option :

But it's mandatory to call 2 dim and when we are calling this I'm not getting expected output.

Thanks,

AS

sunny_talwar
MVP
MVP

May be this

Capture.PNG

=Sum(Aggr(RangeSum(Above(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate)/1000000, 0, RowNo())), UP2GO_2F__pkl_ProductStatus__c, MonthNum))

Added this to your script

TempTable:

LOAD Month

Resident Deliverable;

Left Join (TempTable)

LOAD UP2GO_2F__pkl_ProductStatus__c

Resident Deliverable;

Concatenate(Deliverable)

LOAD *

Resident TempTable;

MonthSort:

LOAD Month,

  Num(Month) as MonthNum

Resident Deliverable

Order By Month;

DROP Table TempTable;

sunny_talwar
MVP
MVP

Slightly modify your script to this

TempTable:

LOAD DISTINCT Month

Resident Deliverable;

Left Join (TempTable)

LOAD DISTINCT UP2GO_2F__pkl_ProductStatus__c

Resident Deliverable;

Concatenate(Deliverable)

LOAD *

Resident TempTable;

MonthSort:

LOAD DISTINCT Month,

  Num(Month) as MonthNum

Resident Deliverable

Order By Month;

DROP Table TempTable;