Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
roger0802
Contributor
Contributor

function IF

Hi to everybody,

Maybe it's a sample question..

is it possible to make a function IF with text, NOT number?

or is there something similar?

example:

if([namefield]=N,a,b)

THANK YOU VERY MUCH!

Ruggero

1 Solution

Accepted Solutions
Not applicable

Hi,

Just use the quotation marks to identify the text field.

Ex:- if([namefield]=' N ',a,b)

See the 'N' in your expression.

Priyantha.

View solution in original post

9 Replies
MK_QSL
MVP
MVP

if([namefield]='N','a','b') as [namefield]

Not applicable

Hi,

Just use the quotation marks to identify the text field.

Ex:- if([namefield]=' N ',a,b)

See the 'N' in your expression.

Priyantha.

nikhilgarg
Specialist II
Specialist II

Hey,

But i think if([namefield]='N','a','b') as [namefield] will also work fine. Isn't it ?

buzzy996
Master II
Master II

u have to try like this,

if([namefield]='N','a','b')

Not applicable

Hi,

not only number text also can work

Ex:

    =if([namefield]='N','a','b') as [namefield])

here, N means some text

tcullinane
Creator II
Creator II

use

if(match([namefield],'N'),'a','b') as [namefield]

match, wildmatch etc are handy for text.

roger0802
Contributor
Contributor
Author

Really thank you to everybody!

Ruggero

Anonymous
Not applicable

Could you please close this thread by marking the correct answer?  And maybe helpful answers as well?

It will give the deserved points to the "answerers", and will help those who use search.

roger0802
Contributor
Contributor
Author

You're right..