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

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
Specialist II
Specialist II

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 ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

6 Replies
jananireddy
Partner - Creator
Partner - Creator

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
Specialist II
Specialist II

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 ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
chris_johnson
Creator III
Creator III

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
Author

Dear Janani,

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

Kind regards,

Alejandro.

Not applicable
Author

Hello Michele,

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

Thanks for your answer .

Not applicable
Author

Hey Adam!

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

Thanks for the answer.