Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Test result is single value dimension and psuedo code as follows
Test Result : Pseudo Code:
if (Update Score='1' then 'Success', if (Update Score=2 then 'Suspect', if (Update Score='3' then 'Failed')))
How this be created ?
i am getting only Failed as a value with if then else condition even though update score is 1 or 2
If Update Score is numeric, you want to use the pick function.
Pick([Update Score], 'Success', 'Suspect', 'Failed')
Yes, pick() was what I was thinking of, not match() . Sorry for missleading you @shrutipg.
Try adjusting the syntax to this:
if ([Update Score] ='1', 'Success', if ([Update Score] =2, 'Suspect', if ([Update Score] ='3', 'Failed')))
You could even try using Match() pick() for this.
Match ([Update Score], 'Success', 'Suspect', 'Failed')
Pick([Update Score], 'Success', 'Suspect', 'Failed')
Hi Vegar,
Thanks , But Update Score returns numeric value ( 1, 2 , or 3)
and result should be success, failed, suspect based on numbers returned, match dint work here
correct me if wrong.
If Update Score is numeric, you want to use the pick function.
Pick([Update Score], 'Success', 'Suspect', 'Failed')
Yes, pick() was what I was thinking of, not match() . Sorry for missleading you @shrutipg.
@shrutipg It is better to create field using applymap in script instead of using calculated dimension.
Map_Score:
mapping LOAD * inline [
Score, Description
1, Success
2,Suspect
3,Failed ];
Data:
LOAD *,
applymap('Map_Score', Updated_Score,'NA') as Description
FROM table;
Now you can use Description field in Dimension.
Thanks , it has worked 🙂
but still not able to add this logic to dimension.
It worked when i added the calculation as measure