4 Replies Latest reply: Dec 16, 2013 11:53 AM by Zebediah Black

# Graphing Previous 6 Months

Afternoon,

I have a simple table with amount and recorddate fields. I've created a Month field (MonthStart) and Year field from the recorddate column. I am trying to graph the previous 6 months using the below set analysis. I searched the QlikView Community and found this expression.

Sum({Month={>=\$(=max(Month)-6 <=\$(=max(Month)'}>} amount

Using that set analysis I get all months <= the selection I make instead of just the previous 6. Any ideas on how to correct this?

• ###### Re: Graphing Previous 6 Months

Are you using MonthStart as your graph dimension?

• ###### Re: Graphing Previous 6 Months

Hi Zebediah,

Kindly use this expression....

sum({1<Date = {">=\$(=MonthStart(Max(Date), -6))<=\$(=MonthEnd(Max(Date)))"}>}Data).

Hope this will solve your issue.

Regards

Suresh Rawat

• ###### Re: Graphing Previous 6 Months

Thanks everyone for your help on this. Suresh provided the correct set analysis to solve the problem I had. I did make an edit to it to address a date formatting issue I was having in the report. What I ended up doing was this ->

sum({<Month = {">=\$(=date(MonthStart(Max(Month),-6), 'MMMYY'))<=\$(date(MonthEnd(Max(Month)),'MMMYY')))"}>}Data).

• ###### Re: Graphing Previous 6 Months

Hi Zebediah,