Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

If () condition not working as intended

Hello guys!

I created the following table

ProductDayMetric_1ObjectiveThreshold
110.560.5Y
210.320.5N
120.290.5N
220.60.5Y

What I want to do, is that if the value Metric_1 is higher than 0.5, put the value 'Y' in Threshold, otherwise, put 'N'.

I used the following formula in Threshold with no luck.

if([Metric_1] < 0.5,'Y','N')

it should be quite simple, isn't it?

I didn't add the formula for metric_1 here because I don't think its important, but I might be missing something crucial in Qlik as the condition seems pretty simple.

Kind regards!

1 Solution

Accepted Solutions
micheledenardi
Not applicable

Re: If () condition not working as intended

Are you calculating the "If statement" during the Load or directly in the table ?

Have you declared the formula as an expression or as a calculated dimension ?

6 Replies
jananireddy
Not applicable

Re: If () condition not working as intended

Hi,

The if statement looks correct

if([CONDITION] > 0.5, TRUEPART, FALSEPART )

A few things you can check is your condition and whether you need to give 0.5 as '0.5' (i.e If the value is numeric or text)

micheledenardi
Not applicable

Re: If () condition not working as intended

Are you calculating the "If statement" during the Load or directly in the table ?

Have you declared the formula as an expression or as a calculated dimension ?

chris_johnson
Not applicable

Re: If () condition not working as intended

Hi,

Are you trying to reference a Column Name in the chart, as opposed to a field?

I remember that you can do that in QlikView but I'm not sure that you can do that in Sense.

Can you try putting the formula from the Metric_1 expression into the Threshold expression  (in place of [Metric_1])?

Not applicable

Re: If () condition not working as intended

Dear Janani,

Thanks for your answer, unfortunately it was all my mistake! I was looking at the wrong metric.

Kind regards,

Alejandro.

Not applicable

Re: If () condition not working as intended

Hello Michele,

I was looking at the wrong metric, it work as intended now!

Thanks for your answer .

Not applicable

Re: If () condition not working as intended

Hey Adam!

It was all my fault, I was looking at the wrong metric.

Thanks for the answer.