Forum Discussion
Anonymous
5 years agoNot applicable
Custom column by using switch case
Hi, I have to add a custom column called"Data" by using below switch case : CASE WHEN Ratio <= 0.05 THEN 5 WHEN (Ratio > 0.05) and (Ratio <= 0.1) THEN 4 WHEN (Ratio > 0.1) and (Ratio <= 0.2) TH...
- 5 years ago
Hi Anonymous
Try this
Score = SWITCH( TRUE(), [Nonstandard_Ratio] <= 0.05, 5, AND([Nonstandard_Ratio] > 0.05, [Nonstandard_Ratio] <= 0.1), 4, AND([Nonstandard_Ratio] > 0.1, [Nonstandard_Ratio] <= 0.2), 3, AND([Nonstandard_Ratio] > 0.2, [Nonstandard_Ratio] <= 0.3), 2, [Nonstandard_Ratio] > 0.3,1 )Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. - Anonymous5 years ago
Hi PhilipTreacy ,
Thank you so much.It worked.
Anonymous
5 years agoNot applicable
Hi amitchandak ,
I am getting this below error.
Note : In the below image i have used Nonstandard_Ratio(because that is my column name) instead of Ratio
Thanks.
PhilipTreacy
5 years agoSuper User
Hi Anonymous
Try this
Score = SWITCH( TRUE(),
[Nonstandard_Ratio] <= 0.05, 5,
AND([Nonstandard_Ratio] > 0.05, [Nonstandard_Ratio] <= 0.1), 4,
AND([Nonstandard_Ratio] > 0.1, [Nonstandard_Ratio] <= 0.2), 3,
AND([Nonstandard_Ratio] > 0.2, [Nonstandard_Ratio] <= 0.3), 2,
[Nonstandard_Ratio] > 0.3,1
)
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
- Anonymous5 years agoNot applicable
Hi PhilipTreacy ,
Thank you so much.It worked.