Ifelse calculation error

Hi team,

I want change label names using calculation filed, so I am trying to write a calculation filed using if else function like : ifelse({metric_category}=‘Yes’,‘Compliance’,{metric_category}=‘No’,‘Non-Compliance’)

But it will show error, could you please help me to resolve or write a correct calculation

Regards,

Chaitanyakumar N

Hi @Cnagabhairava

Can you share the error details of your calculation using ifelse and explain the problem a bit more in detail? The calculation syntax looks correct try ifelse or switch, and please replace field names and values as required for your dataset.

Example:

ifelse({category} = 'Yes', 'Compliance',{category} = 'No', 'Non-Compliance', 'Unknown')

OR

switch({category}, 
               "Yes", "Compliance", 
               "No", "Non-Compliance", 
               "Unknown")

Thank you Xclipse for your answer, it’s working perfect.