Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
mwoolf
Honored Contributor II

Re: Chart definition conditional

Try using a single greater than sign: >

Re: Chart definition conditional

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

Re: Chart definition conditional

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

mwoolf
Honored Contributor II

Re: Chart definition conditional

What does this expression refer to:

[PLAYSSMS ROAMING [ilosc]]1]

Not applicable

Re: Chart definition conditional

this is reference to xls column name PLAYSSMS ROAMING ilosc 1

mwoolf
Honored Contributor II

Re: Chart definition conditional

[PLAYSSMS ROAMING ilosc1]

Not applicable

Re: Chart definition conditional

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

mwoolf
Honored Contributor II

Re: Chart definition conditional

Can you post a qvw?

Not applicable

Re: Chart definition conditional

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)

Community Browser