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

Last 12 Month Sale

Hi Qlikview Team

I have data as below and i have to show last 12 month sales based selection in Effective_Mth field

i have created two variable

vP12YrMth= Date(AddMonths(max(Effective_Mth),-11),'MMM YYYY')

vMaxMth = Max(Effective_Mth)

I use below expression for in chart : sum({<Effective_Mth={">=$(vP12YrMth)<=$(vMaxMth)"}>}Sales). My last 12 month sales it cannot go beyond Nov'14 that means that when click Sept '15 in (effective_mth field) it shows from Sept 15 to Nov 14 only (11 mth sales). even when i click Feb'2014 (effective_mth field) it has shows only Nov 2014 sales only. it cannot show any sales after Nov 14. i have load all the data and shows everything in calendar

Please guide me how to fix it

   

TransDateSalesEffective_Mth
1/1/2014100Jan 2014
2/1/2014200Feb 2014
3/1/2014300Mar 2014
4/1/2014400Apr 2014
5/1/2014500May 2014
6/1/2014600Jun 2014
7/1/2014700Jul 2014
8/1/2014800Aug 2014
9/1/2014900Sep 2014
10/1/20141000Oct 2014
11/1/20141100Nov 2014
12/1/20141200Dec 2014
1/1/20151300Jan 2015
2/1/20151400Feb 2015
3/1/20151500Mar 2015
4/1/20151600Apr 2015
5/1/20151700May 2015
6/1/20151800Jun 2015
7/1/20151900Jul 2015
8/1/20152000Aug 2015
9/1/20152100Sep 2015
10/1/20152200Oct 2015
11/1/20152300Nov 2015
12/1/20152400Dec 2015
1/1/20162500Jan 2016
2/1/20162600Feb 2016
3/1/20162700Mar 2016
4/1/20162800Apr 2016
5/1/20162900May 2016
6/1/20163000Jun 2016
7/1/20163100Jul 2016
8/1/20163200Aug 2016
9/1/20163300Sep 2016
10/1/20163400Oct 2016
11/1/20163500Nov 2016
12/1/20163600Dec 2016
1 Reply
sunny_talwar

Try this expression:

Sum({<Effective_Mth={">=$(=vP12YrMth)<=$(=vMaxMth)"}>}Sales)

While changing your second variable to this:

=Date(Max(Effective_Mth), 'MMM YYYY')

Capture.PNG