Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF Statement

Hi,

Need help transferring this logic into an IF statement.

IF Fieldname  = '1111' or '1112' or '1113' or '11233','ID' AS CODENAME

4 Replies
its_anandrjs

Write like

IF(Match(Fieldname,'1111','1112','1113','11233'),'ID') AS CODENAME

hic
Former Employee
Former Employee

Small correction: You probably want ID to be a field reference. Then you cannot use single quotes. You need double quotes, or square brackets:

     IF(Match(Fieldname,'1111','1112','1113','11233'),"ID") AS CODENAME

HIC

its_anandrjs

Thanks HIC but if ID is as string then it will use like 'ID' or if it is field reference then it will use like

1. If ID is field reference from table then


IF(Match(Fieldname,'1111','1112','1113','11233'),"ID") AS CODENAME

Or

IF(Match(Fieldname,'1111','1112','1113','11233'),[ID]) AS CODENAME



2.If ID is string then it will use like

IF(Match(Fieldname,'1111','1112','1113','11233'),'ID') AS CODENAME


nizamsha
Specialist II
Specialist II

Your r near to the code wht u want some correction check this one

TableA:

LOAD *,if(ID='5'or ID='4',ID) as ID1;

LOAD * Inline [

ID,Amount

1,10

2,20

3,30

4,40

5,50

];