Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Line chart showing values for previous 12 months

Hi There, On the left side in my dashboard i have my Actual Trends and right hand side shows FY and Period.  I want the actual trend Line chart to show the values for previous 12 months, say in click on FY 2016, Period: 3,, i want actual trends to show values from 2015 03 to 2016 03..... Can anybody help me with the same please ? Thanks indeed.

10 Replies
Anonymous
Not applicable
Author

see this, really helpful for you:

Set Analysis for certain Point in Time

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Use set analysis to adjust the dimension values (Timeline) you want to display.

Imagine that you have a Date field somewhere (MyDate) that also exists in Month and Year versions. The latter can be shown as listboxes. The former will be used to control set analysis like this:

=sum({<MyDate = {">=$(=MonthStart(AddMonths(Max(MyDate), -12)))<=$(=MonthEnd(Max(MyDate)))"}>} SalesAmount)

Peter

Not applicable
Author

Thanks a million

Not applicable
Author

Thank you very much

Not applicable
Author

Hey Balaraj,,

This is my expression in here :

if(Headline_Fig= 'Gross Margin', sum({<FY={$(vMaxYear_CompletePeriod)},Period={'>=$(=Min(Period))<=$(=Max(Period))'}, Flag={'Actual'},[Headline_Fig]={'Gross Margin'}>}Amt),

if(Headline_Fig= 'Controllable Contribution', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Controllable Contribution'}>}Amt),

if(Headline_Fig= 'Gross Revenues', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Gross Revenues'}>}Amt),

if(Headline_Fig= 'Net Revenue', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Net Revenue'}>}Amt)))))

What do i need to change in here to make show values for previous 12 months ?

Thanks for the help.. Much appreciated.... Thanks indeed !!

Not applicable
Author

Hey Peter,

This is my expression in here :

if(Headline_Fig= 'Gross Margin', sum({<FY={$(vMaxYear_CompletePeriod)},Period={'>=$(=Min(Period))<=$(=Max(Period))'}, Flag={'Actual'},[Headline_Fig]={'Gross Margin'}>}Amt),

if(Headline_Fig= 'Controllable Contribution', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Controllable Contribution'}>}Amt),

if(Headline_Fig= 'Gross Revenues', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Gross Revenues'}>}Amt),

if(Headline_Fig= 'Net Revenue', sum({<FY={$(vMaxYear_CompletePeriod)},Flag={'Actual'},[Headline_Fig]={'Net Revenue'}>}Amt)))))

What do i need to change in here to make show values for previous 12 months ?

Thanks for the help.. Much appreciated.... Thanks indeed !!

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Probably you cannot use your variable vMaxYear_CompletePeriod and Min/Max(Period) anymore because calculating the lower limit date that is 12 months earlier is ugly (wasted energy) with these fields. Do your data records have a real date field attached? A calendar object?


Peter

Not applicable
Author

Hey Peter,,

Yes it has real date field.. and calendar object

Peter_Cammaert
Partner - Champion III
Partner - Champion III

In your nested IF, there is only one sum() that takes into account your Period selection. The others don't. Do you want them to include the entire previous year?