Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI i have data set , which has Fee collumn flag with value 1 and 0 only . now i want to conver 1= Yes and 0 = no on script.
Hi @Gump123 ,
Can you try:
IF( [Fee collumn flag] = 1, 'Yes',
IF( [Fee collumn flag] = 0, 'No')) AS New_Flag
Slightly more compact:
If([Fee column flag], 'Yes', 'No') as New_Flag
Another technique I like, especially when I have multiple flag fields to map, is to use a mapping table.
YNMap:
Mapping
LOAD num, Dual(str, num)
Inline [
num, str
0, No
1, Yes
];
Map [Fee Flag] using YNMap;
Map [Shipped Flag] using YNMap;
Data:
LOAD * Inline [
OrderId, Fee Flag, Shipped Flag
11, 1, 1
12, 0, 1
13, 0, 0
];
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com