3 Replies Latest reply: Oct 21, 2015 7:16 PM by Stefan Wühl RSS

    [Simple problem] This IF statement with OR's won't evaluate because the search value has a single quotes. How to fix this?

    John Blomqvist

      Hello all,

       

      I have the following IF statement in my script:

       

      If(CategoryName = 'Women's Clothes' or CategoryName= 'Sportswear' or CategoryName = 'Men's Footwear', 1,0) as CategoryType

       

      But the script won't run because Women's Clothes and Men's footwear actually contain single quotes too and Qlikview sees this as a problem.

       

      I thought I could do:

       

      If(CategoryName = "Women's Clothes" or CategoryName= 'Sportswear' or CategoryName = "Men's Footwear", 1,0) as CategoryType

       

      or

       

      If(CategoryName = [Women's Clothes] or CategoryName= 'Sportswear' or CategoryName = [Men's Footwear], 1,0) as CategoryType

       

      But this does not work.

       

      Does anyone know how to fix this minor issue in my IF statement please?