Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting last 6 months of data for current month selected

Hi I'm pretty new to Qlikview and I'm trying to display the last 6 months of data based on the current month selected from a list box.

For ex. If I have Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct in my list box if I clear the data the trending graph should display all months which it does.

If however I select only Aug, the graph should display all months from Mar - Aug (that is last 6 months with respect to current selection)

Can anyone help me with this?

Thanks!

3 Replies
kamalqlik
Partner - Specialist
Partner - Specialist

HI Sajdmalik....what you want ....I mean you want to get the last 6 months sales or what you exactly want

If you want to get salesw of last six month ...than you can go for set analysis.

and use     sum(if(inmonth(Field1, $(vPeriod), -6), Sales))

             here $(vPeriod)=num(MY)

and  MY will be

date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY')

Not applicable
Author

Hi Kamal,

I have a trending graph that displays the field 'Reporting Period' as Jan-2011, Feb-2011......July-2011 and so on on the X-axis and corresponding cost for a particular metric on the Y-axis.

So what I want is when nothing is selected the trending should be displayed for all the months present in the dataset. But if user selects a particular month for Ex: July-2011 the graph should display months from Feb-2011 up until July-2011 i.e basically the last six months.

Thanks!

Anonymous
Not applicable
Author

Hi,

did u get the solution?

I want to do the same thing.

I want to limit the dimension to 6 months, I mean I want to display previous 6 months from last month or selected month.

Basically I want to limit the dimension.