if else if error

Team - I can’t seem to figure out why this won’t work, can anyone enlighten me? I’m sure it’s something simple, but I can’t place it. I’m following other examples that work and for some reason this won’t. “Channel” is a string, VAS ADJ Quota is numeric.

Can anyone offer me guidance?
Thanks in advance - Ryan

if (column(“CHANNEL”) = ‘PLATINUM’){
column(“VAS_ADJ_QUOTA”)*50%
} else if (column(“CHANNEL”) = ‘TERRITORY’){
column(“VAS_ADJ_QUOTA”) * 45%}

I think an else is missing and I do not think “* 45%” is going to work would be: “*0.45”. And a query about something being identical would be “==”:

if( column("CHANNEL") == "PLATINUM" ) { column("VAS_ADJ_QUOTA")*0.5   
}   
else if ( column("CHANNEL") == "TERRITORY" ) { column("VAS_ADJ_QUOTA")*0.45   
}   
else { 999.99
    }
3 Likes

Thanks for helping. It’s working now and I understand why it wasn’t. Appreciate it very much

2 Likes

As an additional disclaimer, be mindful of using == vs .equals()

3 Likes

@ArjenEX good hint. Sometimes it is not so easy to spot which syntax to use …

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.