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: 
Not applicable

Chart definition conditional

Hi all,

I'm trying to run a chart with external data from xlsx. Everything is working since now ok, the data is loaded correctly. I want to show/hide an expression on the chart when it's value is greater ol smaller than defined. I.e if 2+2 >=4 it should show value of summary else should show 0.

I have inserted an is sstatement into expression definition field

if (2+2 >> 4,2+2,0)

but it always shows 2+2 value (4). I'm trying with cnstant values to better understand the if clause, but it doesn't make the difference.

The goal is to make if clause for expression fields (data series) of the chart if(expression1+expression2+expression3 >> 7000, 0, 2000+expression1+expression2+expression3)

How can this be completed?

Best regards

Marcin

10 Replies
m_woolf
Master II
Master II

Try using a single greater than sign: >

Miguel_Angel_Baeyens

Hi Marcin,

Not sure if I got you right, but, did you try using Column() to refer to the different columns within the chart? For example, in a chart where Month is the dimension, and expressions are Sum(Sales) and Sum(Costs), Margin could be

Column(1) - Column(2)

Instead of writing

Sum(Sales) - Sum(Costs)

that will work as well, though.

Hope that helps.

Miguel

Not applicable
Author

still no luck, I've tried the method with one < but doesn't seem to work. Below you will find code attached:

If(PLAYFIXED1+PLAYINTERN1+PLAYORANGE1+PLAYPLAY1+PLAYPLUS1+PLAYROAMING1+PLAYSMS1+PLAYSMS_INT1+[PLAYSSMS ROAMING [ilosc]]1]+PLAYTMOBILE1 < 7000,2000,PLAYFIXED1+PLAYINTERN1+PLAYORANGE1+PLAYPLAY1+PLAYPLUS1+PLAYROAMING1+PLAYSMS1+PLAYSMS_INT1+[PLAYSSMS ROAMING [ilosc]]1]+PLAYTMOBILE1-7000+5040)

I need sum of all columns to test if greater/less than 7000, and if less to put a fixed value, else put a calculated value.

BR

Marcin

m_woolf
Master II
Master II

What does this expression refer to:

[PLAYSSMS ROAMING [ilosc]]1]

Not applicable
Author

this is reference to xls column name PLAYSSMS ROAMING ilosc 1

m_woolf
Master II
Master II

[PLAYSSMS ROAMING ilosc1]

Not applicable
Author

doesn't work neither. I have build the sentence using function builder, not by my own.

m_woolf
Master II
Master II

Can you post a qvw?

Not applicable
Author

Try:

If(PLAYFIXED1+PLAYINTERN1+PLAYORANGE1+PLAYPLAY1+PLAYPLUS1+PLAYROAMING1+PLAYSMS1+PLAYSMS_INT1+[PLAYSSMS
ROAMING ilosc1]+PLAYTMOBILE1 < 7000,‘2000’,((PLAYFIXED1+PLAYINTERN1+PLAYORANGE1+PLAYPLAY1+PLAYPLUS1+PLAYROAMING1+PLAYSMS1+PLAYSMS_INT1+[PLAYSSMS
ROAMING ilosc 1]+PLAYTMOBILE1)-7000)+5040)