Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

cumm Sum

Hi All,

I have the data on date level.

I want to calculate cumulative sum of the Sales for category A.

My formula is sum({<Flag={'A'}>}Sales) .

How to write the cumulative sum for the selected month for each year.

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

='Cummulative Category A Sales ' & Num(Sum({<Flag={'A'}, MonthYear = {"$(='>=' & Date(YearStart(Max(MonthYear)), 'MMM-YY') & '<=' & Date(Max(MonthYear), 'MMM-YY'))"}, Month>}Sales),'#,##0.00')

View solution in original post

3 Replies
sunny_talwar

What is the number you are expecting to see here?

sunny_talwar

May be this:

='Cummulative Category A Sales ' & Num(Sum({<Flag={'A'}, MonthYear = {"$(='>=' & Date(YearStart(Max(MonthYear)), 'MMM-YY') & '<=' & Date(Max(MonthYear), 'MMM-YY'))"}, Month>}Sales),'#,##0.00')

ziadm
Specialist
Specialist

Hi

Create another AsofTable and make MonthYear as the  key to link your sales table with the AsofTable

AsofMonth:

load

MonthYear ,

Sum(Sales) as MonthSale

Resident Dept_Sales

Group by MonthYear;

The formula will be

sum({<Flag={'A'}>} MonthSale )