Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
karthik606
Contributor
Contributor

Different Reference line for different filter Selection

Hi - Can you please let me know how to have different reference line  in a trend chart when selecting different filter in Qlikview? Thanks!

5 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

If you wish to have different Reference lines according to filed selections you might try:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/FieldFunc...

Screenshot_1.jpg

In this case if there is something selected in [YOUR FIELD] than the Reference line will appear if not that it's invisible.

karthik606
Contributor
Contributor
Author

Thanks for your swift response. I have "Hub" as filtering criteria and under that it can be "Hub 1", "Hub 2", "Hub 3", "Hub 4"
If I select Hub 1, then the reference line should be at 500 in the corresponding trend chart.
If I select Hub 2, then the reference line should be at 200.
If I select Hub 3, then the reference line should be at 300.
If nothing is selected, then the reference line should be at 600.

I used the below formula by right click on the Trend chart-->Properties-->Presentation-->Reference Line-->Conditional but it didnt work.

=If (GetFieldSelections(Hub) like 'Hub1*',500)
Elseif((GetFieldSelections(Hub) like 'Hub2*',200)
Elseif((GetFieldSelections(Hub) like 'Hub3*',300)
Else((GetFieldSelections(Hub) like ' ',600)

 Attached the screenshot for quick reference. 

 

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Than in the expression field in Reference line properties use this:
=If(GetCurrentSelections (Hub) = 'Hub1', 500,
If(GetCurrentSelections (Hub) = 'Hub2', 200,
If(GetCurrentSelections (Hub) = 'Hub3', 300,
If(Len(GetFieldSelections(Hub)) = 0, 600))))
karthik606
Contributor
Contributor
Author

I just tried this and it works only without selection. I am trying to make it work individually for Hub1,Hub2 and Hub3.

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

My bad, try this:

If(Right(GetCurrentSelections (Hub), 4) = 'Hub1', 500,
If(Right(GetCurrentSelections (Hub), 4) = 'Hub2', 200,
If(Right(GetCurrentSelections (Hub), 4) = 'Hub3', 300,
If(Len(GetFieldSelections(Hub)) = 0, 600))))

 

About GetCurrentSelections:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/FieldFunc...