Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hide or show reference lines on charts

Hello QV community

I am a new with QV development I and I have of problem that I am not been able to find an suitable solution. I hope that some one could help me.

I am creating a chart that plots quantities of 3 different areas day, so for each day I have 3 bars in the chart.

I have created 3 reference lines, one for each area and have plotted in the same chart, so I can visualize the target and real quantity.

My problem is that I want to plot the reference lines only when I select the correct Area, and hide the reference line when the area is not selected/plotted.

So what I have done was to create a conditional expression for the reference line and I have done the following : if(AREA='200',dailyTargetVolumeSanding,0), this means if the area 200 is selected will be plotted the dailyTargetVolumeSanding reference line if not nothing will be plotted. This works fine I have have selected just only one line but if i select for example the line 170 and 200 the dailyTargetVolumeSanding is not plotted.

Someone could help me on how can I test in the expression when I have selected multiple areas to check if some of those areas is the area 200?

Thank you

Felipe

1 Solution

Accepted Solutions
jonasheisterkam
Partner - Creator III
Partner - Creator III

Use sum(if(AREA='200',1)). With aggregation you check each datarow else it is nearly like a only

View solution in original post

5 Replies
jonasheisterkam
Partner - Creator III
Partner - Creator III

Use sum(if(AREA='200',1)). With aggregation you check each datarow else it is nearly like a only

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Use something like this for your reference line expression:

if (substringcount(';' & gefieldselections(AREA, ';', 50) & ';', ';200;') > 0, sum(daily...))

This is a complex version of a simple expression because it will match only one of selections 200, 2000 and A2000. It will match none of 2000, A2000 or 200X.

Anonymous
Not applicable
Author

Great tip. It works perfectly.

Thank you

Felipe

Anonymous
Not applicable
Author

Peter

I have also tried your suggestion and works fine. I just have made a small modification.

if (substringcount(getfieldselections(AREA, ';', 50) , '200') > 0, dailyTargetVolumeSanding,0)

Thank you

Peter_Cammaert
Partner - Champion III
Partner - Champion III

That's the simple version of the expression I was talking about. I didn't know what other areas were available in you data so I took the careful approach.

Good luck,

Peter