Problem with keychain expression


I am working on a report, and want to translate the original priority statements in alarming report ("Critical,High,Medium,Low").
I have tried the following in the table;


This is resulting in that all result is set to "C" even though there are critical alarms in the list. Is there something wrong in my expression?

Best regards,

EDIT :slight_smile:

I resolved this by myself. Tried a lot of ways, but the only way(so far) I got it to work was to compare the substring with a string, so my expression was like this ; "@substring(priority,0)=="Critical"?"A":substring(priority,0)=="Medium"?"B":substring(priority,0)=="Low"?"C"@"