Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to show the last 3 months of data on a bar chart

I am trying to show the last 3 months of data on a bar chart when selecting a specific month (example:  Select June 2014 and display April, May & June 2014 data).  I also need to be able to further filter that data on other filters shown on the screen shot I attached.

I am using the following statement in my chart expression:

=Sum ({$<MONTH=,LN_MonthEND={'>=$(MonthStart(vSelectedMaxDate,-3))<=$(MonthEnd(vSelectedMaxDate))'}>}Net_Bal)

The chart is displayed but it is showing the most current set of months (June, July & August).  If I remove the "MONTH=" parameter, then only the selected month appears in the chart and no others.  Using the "MONTH=" parameter is telling QlikView to ignore the selected MONTH value so the most current months are displayed.   What am I missing???

The screen shot shows the variables that I am using in the calculation and their values when selecting June 2014.  The table behind this application contains data with the LN_MonthEnd column having month end values for Jan, Feb, Mar, Apr, May, Jun, Jul and Aug 2014.

Any help would be appreciated.

Thanks,

Ed

4 Replies
Anonymous
Not applicable
Author

for rolling 3 month use this expression

  • Sum({$<MonthID = {“>=$(=Max(MonthID) – 2)<=$(=Max(MonthID))”},
    Year = ,
    Quarter = ,
    Month = >} Sales)

where MOnthID = primary key (numerical number)

Hope it helps

Sri1

ecolomer
Master II
Master II

Here you have an example

abhaysingh
Specialist II
Specialist II

Hi Enrique,

Thanks For Help.. This is Done but same trend i want in case of Week.. Like Current Week with last 3 month week sales..

can you pls help me in this.

ecolomer
Master II
Master II

Hi,

For weeks is the same

If you send me your file and the requeriments, I can to help you more

Saludos,

EC