Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Month Trending with the Selections

Hello everyone,

I'm trying to show the trending for Month in BAR chart. Usually when we select the month from the list box, it will show the particular selected month data only.

My requirement is when I select the Month from the list box, It should show the previous 5 months data along wit current month.

For example If i select the Month-Year as April 2016 then the bar chart should display the trending for April 2016, March2016, Feb2016, Jan 2016, Dec2015, Nov 2015.

Please help.

Thanks,

Rajitha

mrkachhiaimpphaneendra.kunchestalwar1

1 Solution

Accepted Solutions
sunny_talwar

I guess, something like this:

If([Month-Year] <= Max(TOTAL [Month-Year]) and

   [Month-Year] >= AddMonths(Max(TOTAL [Month-Year]), -5), [Month-Year])

But make sure to ignore selection in [Month-Year] field in your expression. Assuming you have Sum(Sales) as your expression, change it to -> Sum({<[Month-Year]>} Sales)

View solution in original post

3 Replies
sunny_talwar

May be using set analysis:

{<[Month-Year] = {"$(='>=' & Date(AddMonths(Max([Month-Year]), -5), 'MMM YYYY') & '<=' & Date(AddMonths(Max([Month-Year]), 0), 'MMM YYYY'))"}>}

Now I am not sure how you create Month-Year in script, but why is some months complete name (March) vs. others have short month name (Feb)?

Anonymous
Not applicable
Author

Sorry all the months have the same format MMM/YY. I'm trying to write this in Calculated Dimension. Is this possible. Please advise?

sunny_talwar

I guess, something like this:

If([Month-Year] <= Max(TOTAL [Month-Year]) and

   [Month-Year] >= AddMonths(Max(TOTAL [Month-Year]), -5), [Month-Year])

But make sure to ignore selection in [Month-Year] field in your expression. Assuming you have Sum(Sales) as your expression, change it to -> Sum({<[Month-Year]>} Sales)