Skip to main content

6.3 IFF

IFF is a shorthand version of the CASE statement, available in some SQL dialects (like T-SQL and of course Snowflake). It’s a straightforward way to write a conditional expression, similar to the “IF” function in Excel or Salesforce formulas. It evaluates a condition and returns one value if the condition is true and another if it’s false.

SELECT 

IFF ("COUNTRY" =  "NUMBEROFLOCATIONS__C" >1 AND "COUNTRY" = 'USA' ,'US Muli-Location','Other') "Location Classification"

FROM SFDC.STAGE.LEAD