Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
omyahamburg
Creator II
Creator II

prior period comparison

Hello all

Can someone help ? My head is blocked by end of this week.

I have a table where I show a sum for a dimension Periode:

PeriodeSum (Restmenge)
2013-Jan6.125.024,43
2013-Feb5.932.647,27
2013-Mrz5.716.283,74

Periode is coming out of my script:

 

year (Date)&'-'&month(Date) as  Periode

How to I write the expression to sum Restmenge for 2012-Jan and so on ?

Thanks for your help.

Joerg

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Instead of

     year (Date)&'-'&month(Date) as  Periode

     Create a filed Periode as Monthname(Date) as Periode.

     This will result into Mar 2013 and so on.

     Now You can use below expression to get the last month data.

     =sum({<Periode= {"$(=Monthname(addmonths(max(Date),-1)))"},Year=>}Sales)

Regards,

Kaushik Solanki    

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

Dear Kaushik

Thank you, I'll try latest on Monday and will let you know.

best regards

Joerg