# App Development

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor

## sum of sales on the max available date of each month

I am trying to find out the sum of sales on the max available date of each month.

i am using the below set analysis:

SUM({<[Date]= {"=Aggr(max([Date]),[Month])"}>}[Sales])

the above expression returns the sum of sales on the first day of each month

even though Aggr(max([Date]),[Month]) returns the correct max available date of each month.

Labels (1)
• ### Set anaysis

15 Replies
Master II

If you have month as a dimension the below shall work

`SUM({<[Date]= {"\$(=max([Date]))"}>}[Sales])`
Learning never stops.
Contributor
Author

It gives the sum sales on the max date of the max month.

However i need the sum of sales on the max date of all the month.

I need to make a master measure like that .

Hence when put against any dimension it should give the sum of sales on the max date of each month for that dimension

Master II

as i said if you have month as a dimension the above expression shall work.

Learning never stops.
Contributor
Author
It is not. It is only giving the sum of sales for the latest month.
Partner

Hi,

Maybe using the Dollar Sign Expansion in your Set Analysis will help, like:

SUM({<[Date]= {"\$(=Aggr(max([Date]),[Month]))"}>}[Sales])

Master II

My bad. I didn't realise what you wanted. Set analysis is calculated once per chart so taht's obvious.

your expression shall work, i tried it.

What dimension are you using? I tried with similar sample data and it's working for me.

Learning never stops.
Contributor
Author