Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
adarsh_a
Contributor III
Contributor III

Fiscal Year Accumalation

Hi All,

        I have to calculate cumulative sum based on fiscal year i.e from April of last year to march of current year

Eg:

          Capture1.PNG

  The Output should be like this:

Capture2.PNG
I'm able to get cumulative sum based on calendar year using the expression

 

aggr(RangeSum(Above(Sum(Sale),0,RowNo())),Year,New_Month)

How to do it for fiscal Year?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

In this case you can use a quick-and-dirty like this one:

Data:

LOAD Date,

     Sale,

     if(month(Date)=4,Sale, rangesum(Sale, peek(CumulativeSale)))as CumulativeSale

FROM

Fiscal_Year_Accumulation.xlsx

(ooxml, embedded labels, table is Sheet1);

A more robust solution would be to create a Fiscal Year calendar (see this blog post: Fiscal Year) and perhaps create an AsOf table for easy accumulations (see Calculating rolling n-period totals, averages or other aggregations).


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

In this case you can use a quick-and-dirty like this one:

Data:

LOAD Date,

     Sale,

     if(month(Date)=4,Sale, rangesum(Sale, peek(CumulativeSale)))as CumulativeSale

FROM

Fiscal_Year_Accumulation.xlsx

(ooxml, embedded labels, table is Sheet1);

A more robust solution would be to create a Fiscal Year calendar (see this blog post: Fiscal Year) and perhaps create an AsOf table for easy accumulations (see Calculating rolling n-period totals, averages or other aggregations).


talk is cheap, supply exceeds demand
adarsh_a
Contributor III
Contributor III
Author

Thanks for the solution, it is working