Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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?

1 Solution

Accepted Solutions
suresh_rawat
Creator II
Creator II

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

View solution in original post

4 Replies
Clever_Anjos
Employee
Employee

Are you using MonthStart as your graph dimension?

suresh_rawat
Creator II
Creator II

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

VishalWaghole
Specialist II
Specialist II

Hi Zebediah,

Please Try this, Hope it will help you

= Sum({<Month = {">=$(=max(Month) - 6) <=$(=max(Month))"} >} Sales)

- Regards,

Vishal Waghole.

Not applicable
Author

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).