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

If condition to give value to a new field

I have a table like this:

NationNameANameB
ITabc
ITdefdef
FRa2d123
FR456

I need to have this result

newname
abc
def
123
456

I try with

LOAD *,

     if("Nation" <> 'IT', NameB, NameA) as newname;   

And also  with

LOAD *,

     if("Nation" = 'IT', NameA, NameB) as newname;   

But in newname field I find only value form NameB  (case1) or form NameA (case 2).

I don't know why.

Thank you

A

1 Solution

Accepted Solutions
sunny_talwar

May be try this:

If(NOT WildMatch("Nation", '*IT*'), NameB, NameA) as newname;

View solution in original post

5 Replies
neelamsaroha157
Specialist II
Specialist II

Check the attached file

sunny_talwar

May be try this:

If(NOT WildMatch("Nation", '*IT*'), NameB, NameA) as newname;

sunny_talwar

or this:

If(KeepChar(Upper("Nation"), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') = 'IT', NameB, NameA) as newname;

Not applicable
Author

Thank you, this was not what I need but it can be very usefull.

Not applicable
Author

Thank you very much.