Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

addmonths and set analysis

Hi guys,

I am stuck on something and since I'm new to set analysis I dont know how to procced. I have the following expression:

  Sum({<Month = {"$(=month(addmonths(Max(Date),-1)))"},Year=,Date=>}Sales)

The expression basically SUMS the previous months "Sales". This works perfectly but when I only have a years data. But when I have sales for more than a year (i.e there are multiple Feb (2012 &2013) it sums the sales for both years. I just want the previous months sales.

Any ideas?

Regarss

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try:

Sum({<Month = {"$(=month(addmonths(Max(Date),-1)))"},Year={'$(=Year(addmonths(Max(Date),-1)))'} ,Date=>}Sales)


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Try:

Sum({<Month = {"$(=month(addmonths(Max(Date),-1)))"},Year={'$(=Year(addmonths(Max(Date),-1)))'} ,Date=>}Sales)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks man,

Works like a charm.

How can i work on my set analysis? I know practice. But do you know of any material or forums other than this one?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attached exmaple.

     Hope this will clear your doubt.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!