Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
vinay_bangari
Valued Contributor III

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

Tags (1)
1 Solution

Accepted Solutions

Re: Month Trending with the Selections

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)

3 Replies

Re: Month Trending with the Selections

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

vinay_bangari
Valued Contributor III

Re: Month Trending with the Selections

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

Re: Month Trending with the Selections

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)

Community Browser