Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am hoping someone can help me, as I am trying to write a formula in my script to create a new field and what I have written below tells me it is wrong when I close the brackets. I am sure I am missing something simple but just not seeing it.
This is what I have written:- IF("AREA_ID" = '1' or
IF("AREA_ID" = '5' or
IF("AREA_ID" = '6' or
IF("AREA_ID" = '7', 'NORTH',
IF("AREA_ID" = '2' or
IF("AREA_ID" ='3' or
IF("AREA_ID" = '4', 'SOUTH','OTHER'))))))) as DivisionalOpsArea
I tried this as well but it seems to have ignored most of the staement as it only returns a small amount of data saying North.
IF("AREA_ID" like '1' or '5' or '6' or '7', 'NORTH',
IF("AREA_ID" like '2' or '3' or '4', 'SOUTH','Other')) as DivisionalOpsArea
Thanks for any help in advance
Viv
Hi,
IF(match(AREA_ID , '1' , '5' , '6' , '7')>0, 'NORTH',
IF(match(AREA_ID , '2' , '3' , '4')>0, 'SOUTH','Other')) as DivisionalOpsArea.
Try this method in if statement
Hi,
IF(match(AREA_ID , '1' , '5' , '6' , '7')>0, 'NORTH',
IF(match(AREA_ID , '2' , '3' , '4')>0, 'SOUTH','Other')) as DivisionalOpsArea.
Try this method in if statement
u should write the script like this
if(
AREA_ID=1 or AREA_ID=5 or AREA_ID=6 or AREA_ID=7 ,'NORTH',
if(AREA_ID=2 or AREA_ID=3 or AREA_ID=4 ,'SOUTH',
'Others')) as DivisionalOpsArea