# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Honored Contributor 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

1 Solution

Accepted Solutions
Honored Contributor III

## Re: Cumulative Sum Help!

Hi Sunny,

Thank You!

I already got solution to my problem.

This happens, when the second Dimension isn’t completely filled on each month. So with the AsOfTable concept which is explained very good under following link you can build up a nice solution which is easy to handle and give you much more flexibility.

Thanks,

AS

23 Replies

## Re: Cumulative Sum Help!

Hi,

Check this.

Rangesum cumulative with 2 dimensions | Qlik Community

If doesnt help share your application.

Regards,

Kaushik Solanki

Honored Contributor III

## Re: Cumulative Sum Help!

Hi Solanki,

I tried this but it's not working:

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

Marked in bold are my 2 dim.

Thanks,

As

MVP

## Re: Cumulative Sum Help!

maybe try

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

Honored Contributor III

## Re: Cumulative Sum Help!

Sorry Kush not working.

Attached is sample.

Thanks,

AS

MVP

## Re: Cumulative Sum Help!

try this

rangesum(above(total sum(aggr(sum(fcur_PeakAnnualRevenue__c)/sum( distinct Rate), CurrencyIsoCode, Month))/1000000,1,RowNo(TOTAL)))

Honored Contributor III

## Re: Cumulative Sum Help!

Sorry not working!

Thanks,

AS

MVP

## Re: Cumulative Sum Help!

What is the output you are expecting to see here? You have UP2GO_2F... and Month as your dimensions, but you aggregating on CurrencyIsoCode and Month? Can you provide what the output needs to look like in numerical terms

Honored Contributor III

## Re: Cumulative Sum Help!

Hi Sunny,

Current :

But Output should be like below Stage values on Bar

 Month Stage Jan \$51.35 Feb \$53.88 Mar \$132.70 Apr \$200.48 May \$202.90 Jun \$327.13 Jul \$487.90 Aug \$580.32 Sep \$733.42 Oct \$993.76 Nov \$1,014.90 Dec \$1,163.88

Thanks,

AS

Honored Contributor III

## Re: Cumulative Sum Help!

Sorry This is Current Senario:

And Output in above is comment is required.

Thanks,

AS