Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have expression like if(status=A,green,
if(status=B,Amber,
if(status=C,Red,Grey))).
How can we rewrite this Expression using Pick(Match) function for else condition also.
Regards,
Piyush Jain
pick(match(status, 'A', 'B', 'C')+1, 'Grey', 'green', 'Amber', 'Red')
pick(match(status, 'A', 'B', 'C')+1, 'Grey', 'green', 'Amber', 'Red')
Hi Piyush,
PFA..........
- Regards,
Vishal
Hi Piyush,
Hope i think help this,
Dev01:
LOAD * Inline
[
Flag,Color
R,RED
G,GREEN,
B,BLUE
Y,YELLOW
];
LOAD Pick(Match(Flag,'R','G','B','Y','W'),Color,Color,Color,Color,Color) as Mat_Val Resident Dev01;
Regards,
Raj.
Hi Vishal,
Thanks for your suggestion. but if i am not selecting anyfied the text box is showing null. it must show 'grey
'.
Regards
Piyush
Hi Gysbert,
Please bear with me for very basic question.
Could you please explain how +1 is working in below function.
pick(match(status, 'A', 'B', 'C')+1, 'Grey', 'green', 'Amber', 'Red')
Many Thanks
In the case a status other than A, B or C is encountered the match function will return 0 because there is no match. To make sure the pick function will return something it's necessary to add 1 to the result of the match function since the pick function cannot pick the 0-th value in a list. The first parameter of the pick function must be larger than 0.
Thank you so much
Its clear to me now
Regards,
Pooja