Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart Expression conditionally Show value

Hello All,

I am working on an application to show data points on the chart conditionally. i.e. if myField is not numeric (i.e. max(myField) is Null) then the dual value of the data point must show up.

I have an expression:

=if(TesterTypeVersion = 'MyTestVersion', if(IsNull(max(myField)),Dual('AlternateText',-120), max(myField)))

Dimensions used:

Frequency.

I am assigning the dual value of "AlternateText" if my expression evaluates to null.

The issue am facing is: If I choose the "Show Value" Attribute Expression and give the definition for it as =max(myField) = Null(), it shows up the value of "-120" instead of the dual value of "AlternateText". However if I check the box - Values on datapoints at the bottom of the expressions tab, then the dual representation is shown along with all the other datapoints value on the graph. I would like to see only the data point value of AlternateText.

I have the "Plot Values inside the segment" checkbox checked under the Presentation tab. Is there anything that I am missing?

Or is there an alternate way to achieve the same?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

For a line chart, you have to do a bit of a trick.

1. Change to combo chart.

2. Repeat the expression.

3. On the second expression. select "Bar" and "Invisible"

See attached.

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If I understand your question correctly, it works for me with just a "Show Value" attribute expression. See attached and tell me if it works for you. Could be a version bug.

datapoint.JPG.jpg

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Hello Rob,

I am using a line chart. With bar chart the above example works fine. When I change it to line, it displays -120 instead of AlternateText.

Is there a difference in them or any other options that need to be set?

Thanking you

Preethi

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

For a line chart, you have to do a bit of a trick.

1. Change to combo chart.

2. Repeat the expression.

3. On the second expression. select "Bar" and "Invisible"

See attached.

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Hello Rob,

Thank you. That helped.

Thanking you

Preethi