4 Replies Latest reply on Aug 6, 2012 2:46 PM by Amber Kuo

# Streamline Calculated Field Syntax

How do I simplify the following statement?  I have about 50 agency ids that need to be labeled as OTA.  Do I really need to start with a new ELSEIF row for every Agency ID?

If [AGENCY_ID] = '07508546' then 'OTA'

ELSEIF [AGENCY_ID] = '07591640'then 'OTA'

ELSEIF [AGENCY_ID] = '07560685'then 'OTA'

ELSEIF [AGENCY_ID] = '17209883'then 'OTA'

ELSEIF [AGENCY_ID] = '39557711' then 'OTA'

ELSEIF [AGENCY_ID] = '39605263' then 'OTA'

ELSEIF [AGENCY_ID] = '39621046' then 'OTA'

ELSEIF [AGENCY_ID] = '45500044' then 'OTA'

ELSEIF [AGENCY_ID] = '45537284' then 'OTA'

ELSEIF [AGENCY_ID] = '45545172' then 'OTA'

ELSEIF [AGENCY_ID] = '45568401' then 'OTA'

ELSEIF [AGENCY_ID] = '45602981' then 'OTA'

ELSEIF [AGENCY_ID] = '45615835' then 'OTA'

ELSEIF [AGENCY_ID] = '45623955' then 'OTA'

ELSE [CHANNEL] END

• ###### 1. Re: Streamline Calculated Field Syntax

Hi Amber,

Is there anything else that these AGENCY_IDs have in common that would easily distinguish them from the others?

-Tracy

• ###### 2. Re: Streamline Calculated Field Syntax

No, nothing else.

I was just wondering if there is a syntax that would work such as:

If [AGENCY_ID] = ('07508546', '07591640', '17209883', '39557711', etc) then 'OTA'  ELSE [CHANNEL] END

(Obviously, I already tried that format, and it didn't work.)

• ###### 3. Re: Streamline Calculated Field Syntax

The formula could be written like the following:

If [AGENCY_ID] = '07508546' or [AGENCY_ID] = '07591640' or [AGENCY_ID] = '07560685' or.. etc then 'OTA' else [CHANNEL] end

1 of 1 people found this helpful
• ###### 4. Re: Streamline Calculated Field Syntax

Thanks!