Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rcorcoran
Creator
Creator

Chart showing previous years

Hi

Looking for help with a line chart

I have attached a file with two line charts.  It is supposed to show this year V previous 2 years and target.

Chart 1 is doing this but the expressions are hard coded with the years.  What I really want is like Chart 2 which is working fine if 2014 is selected but when 2015 is selected because there is no data in yet for 2015 it is not showing any of the years.  So I need this to show the previous years even if there is no data in the current year.

Any help would be appreciated

Thanks

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Label

=Max(ReferredYYYY)

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY))'}  >}ActualValue)

Label

=Max(ReferredYYYY)-1

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY)-1)'}>}ActualValue)

Label

=Max(ReferredYYYY)-2

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY)-2)'}>}ActualValue)

View solution in original post

4 Replies
Anonymous
Not applicable

I tried the follwoing Expression for year -1 and year -2 and I get the same Chart as Chart1

for year-1:

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'($(=max({1}ReferredYYYY)-1))'}>}ActualValue)

MK_QSL
MVP
MVP

Label

=Max(ReferredYYYY)

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY))'}  >}ActualValue)

Label

=Max(ReferredYYYY)-1

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY)-1)'}>}ActualValue)

Label

=Max(ReferredYYYY)-2

Expression

=Sum({1<[HWB Screen] ={1},RDOKey={99},ReferredYYYY={'$(=Max(ReferredYYYY)-2)'}>}ActualValue)

rcorcoran
Creator
Creator
Author

Thanks so much Manish that works perfectly

R

rcorcoran
Creator
Creator
Author

Thanks both of you for your help