Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Partner - Creator III
Partner - Creator III

Reference line on line chart

Hello Qlik Developers

I have a line chart in which i have reference lines based on the lab selection the reference lines will appear on the chart. I have written expression for the reference lines its working fine. But my sales team is going to add more labs and values to the data. I have hard coded ! the expressions. I want the reference lines to be automatic. Can someone help me please?

Thanks

Anil

1 Solution

Accepted Solutions
dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Thanks Steve. I have achieved this by writing the below expressions. Its displaying the reference lines based on the selections.

=SubField(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';',

(SubStringCount(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';')-1))

=SubField(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';',

(SubStringCount(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';')))

Thanks

Anil

View solution in original post

2 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Is it that you would only want to show reference lines if one Lab was selected?

If so, simply load in a table which has the Lab name (with a matching field name to the current Lab field) and each of the values you want to show, e.g. CD Pass Limit.

Each expression would then be simply:

=Only([CD Pass Limit])

The only function will return null if there is more than one possible value, or the value if there is only one.

If you wanted to blend the values for the lines across Labs you could use:

=Avg([CD Pass Limit])

This would give you values that were not particularly meaningful though, I would suggest.

Hope that helps.
Steve

dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Thanks Steve. I have achieved this by writing the below expressions. Its displaying the reference lines based on the selections.

=SubField(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';',

(SubStringCount(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';')-1))

=SubField(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';',

(SubStringCount(Concat(Distinct cluster_density.failAbove,';',cluster_density.failAbove),';')))

Thanks

Anil