Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
felipegoncalves
Contributor III
Contributor III

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
Partner

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
Partner

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

View solution in original post

Peter_Cammaert
Partner
Partner

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.

felipegoncalves
Contributor III
Contributor III
Author

Great tip. It works perfectly.

Thank you

Felipe

felipegoncalves
Contributor III
Contributor III
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
Partner

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