Formula where value contains a single quote

Options

I'm looking to write a formula where the value I'm searching for contains a single quote. Because Domo views single quotes as the start and end of my value, I receive a syntax error. Any known workarounds so that I can include a single quote without throwing off the formula?


This is the formula I'm going for:

(CASE when `commitment_comb` like '%Q1 '22%' then 'Q1 2022' else 'other' end)

Answers

  • GrantSmith
    Options

    If you double up the single quotes it'll escape it to a single quote in your string:

    (CASE when `commitment_comb` like '%Q1 ''22%' then 'Q1 2022' else 'other' end)
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • BrittanyD
    Options

    Awesome, thank you!