IN function

Options

Is the SQL IN function not supported by Domo? I've noticed when I attempt to use this, the Beastmode (or ETL function) is saved without error, but it doesn't seem to pull in the results.

i.e. case when 'event_name' in ('page_view','session_start','scroll') then 'Yes' else 'No' end

Best Answer

  • ColemenWilson
    edited July 2023 Answer ✓
    Options

    No you cannot. You would have to do: CASE WHEN `session_medium` LIKE('%Email%') OR `session_medium` LIKE('%email%') OR `session_source` LIKE('%Email%') OR `session_source` LIKE('%email%') THEN 'Email' ELSE 'Whatever' END

    I would recommend using LOWER() function so you don't have to have both Email and email in your statement.

    If I solved your problem, please select "yes" above

Answers

  • ColemenWilson
    Options

    The IN function is supported and your case statement looks correct. There may be an underlying data issue, capitalization issue, or something else.

    If I solved your problem, please select "yes" above

  • NathanDorsch
    Options

    can you use wildcards in an In statement?

    =when SESSION_MEDIUM in ('%Email%','%email%') or SESSION_SOURCE in ('%Email%','%email%') then 'Email'

  • ColemenWilson
    edited July 2023 Answer ✓
    Options

    No you cannot. You would have to do: CASE WHEN `session_medium` LIKE('%Email%') OR `session_medium` LIKE('%email%') OR `session_source` LIKE('%Email%') OR `session_source` LIKE('%email%') THEN 'Email' ELSE 'Whatever' END

    I would recommend using LOWER() function so you don't have to have both Email and email in your statement.

    If I solved your problem, please select "yes" above