Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Expression Syntex

Hi Friend, I have a field Gender, Data is this field like this :

In this field is MALE, M, FEMALE, F like this

I want this in the format of Male and Female, So need syntax for the same.

Regards,

AK

 

Labels (1)
2 Replies
sona_sa
Creator II
Creator II
Author

Got it :

if(Gender = 'M' or Gender = 'Male','Male', If(Gender = 'F' or Gender = 'Female', 'Female','Unkown')) as Gender_Name

NitinK7
Specialist
Specialist

I think better and optimized way to do at backend using applymap

see below example.

A:
Mapping load * Inline[
gender, Gender
Male, Male
M,Male
Female,Female
F,Female
];

Temp:
load * Inline [
gender
Male,
M,
Female,
F
];

LOAD
ApplyMap('A',gender) as Gender
Resident Temp;
DROP Table Temp;

NitinK7_0-1614843732727.png