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

How to use variable in IF statement

Hi,

I'm bothering myself with one problem.

I would like to compare a value that I calculate and it is stored in variable with the Value from Field and then to color Background.

When I change the variable with inputed value it works fine, but with variable not.

What I am doing wrong?

This the End result.

variable value in text box

Is it problem with compare string and number? Or?

Please advice.

Thx

Tom

6 Replies
Kushal_Chawda

what is the expression for that variable?

Try to apply num function over expression like num(expression)

Not applicable
Author

Have already tried this and many other ideas.

Will try again.

Thx

sasiparupudi1
Master III
Master III

your formatting of the number is different to the value that is  being compared..

one is having . and another is having a comma..

you can not compare number with a string

fix it and it should work

hth

Sasi

Not applicable
Author

just a minute ago I've changed the Number format in properties.

Still no success.

I 'm aware the problem lies comeprrison.

How can I define that these two values are string?

thx

Tom

sasiparupudi1
Master III
Master III

you could may be try

num(replace('$(vX)',',','.'),'0.00')

where vX is your variable

Not applicable
Author

Just did it in Load statement.

I was loading dataset with comma, instead .

Will see result.

thx