Skip to main content
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: 
datanibbler
Champion
Champion

Display a certain formula (traffic-light-gauge) in one line only?

Hi,

I have a table diagram with two lines - in one line, there are budgeted figures, in the other there are the actual figures.

I have added a traffic-light-gauge that should turn green when a specific cell in the 2nd line is greater than the same cell in the 1st line, otherwise it should turn red.

The trick is, this traffic-light-gauge should only be displayed in the 2nd line (actual figures).

Sorry, this sounds terribly easy and basic, but it seemingly isn't - I can use set_analysis to compare the same column in two different lines, but whenever I try to include an IF clause to display the traffic_light only in the 2nd line, it disappears altogether...

Thanks a lot!

Best regards,

DataNibbler

5 Replies
RedSky001
Partner - Creator III
Partner - Creator III

See the attached example.

Note in the chart properties on the presentation tab I added just one segment and the colour is set using a calculated expresison

if( sum({$<Type={'A'}>}Amt) / sum({$<Type={'B'}>}Amt)< 1,Red(),green())

Mark

datanibbler
Champion
Champion
Author

Hi msheraton,

well, that is not quite what I want - maybe I was somewhat imprecise in formulating my requirement:

The traffic-light-gauge should be part of the diagram - it is, in fact, a formula represented as a traffic-light-gauge that just returns 1 or (-1), according to the relation between two values (in two rows, same column).

I can build that and I get the traffic-light all right - only it is displayed in both columns and when I try nesting the formula I use there in an IF clause (querying the Line_ID, an auxiliary column), it is not displayed anymore at all.

Thanks for helping anyway!

Best regards,

DataNibbler

RedSky001
Partner - Creator III
Partner - Creator III

Can you upload an example of what you've done so far and describe what you want to happen with the actual data in the qvw?  That would make helping you much easier.

datanibbler
Champion
Champion
Author

Hi,

I have made it now - don't know why it didn't work before, I haven't actually changed tack - I enclose the actual formula in an IF clause so the value is displayed only in a specific line and not in the other one.

Thanks for helping anyway!

Best regards,

DataNibbler

RedSky001
Partner - Creator III
Partner - Creator III

No worries, good to see you got it working