cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CASE statement in Calculated column

Former Member
0 Likes
10,028


Hi Frzz,

I have below requirement in Calculated column with CASE statement. Could some one help me how to achieve this with case statement.

String  =   0Hello

                01Hello

                012Hello

                0123Hello

If  1st Character of the string is '0' then  -  0Hello

    1st 2 characters of the String is '01'  -   22Hello

    1st 3 characters of the String is '01'  -   333Hello

    1st 4 characters of the String is '01'  -  4444Hello

Thank you.

Best Regards,

Krishna.

View Entire Topic
Former Member
0 Likes

Hi everyone,

I've looked through the previous examples and think that mines is a bit different because it is an integer data type. Below is my statement. I am trying to create a calculated column based on ALERTID, for integers between 2051-2073 I want the text 'Turkish to be displayed', then for 1-2050 i want it text to be 'INIT'.

case("ALERTID",2051-2073,'TURKISH',1-2050,'INIT','NONE')

Can someone show me how this code should look? I don't get an error but I don't get the correct

results.

Thanks,

Connor Nelson

Former Member
0 Likes

Hello Nelson,

The above scenario which you have mentioned using case might not use a particular range eg(1-2050),it is considered as a MINUS but for a range. So i have rewritten another code using "nested IF" statement.

if("ALERTID"<=2050,'INIT',if("ALERTID">2050,'TURKISH','NONE'))

Hope it is helpful.

Thanks,

Krishna

Former Member
0 Likes

Awesome, I was able to take what you did and alter it a bit so it does ranges.

if("ALERTID">2050 and "ALERTID"<2074 ,'Turkey',if("ALERTID">2074,'South Africa','NONE'))

Thank you Krishna

Former Member
0 Likes

Anytime Mr.Nelson , Always happy to help !!

Regards,

Krishna