Disregard - failed to convert value from string to boolean

NathanDorsch
NathanDorsch Member
edited November 2022 in Magic ETL

Can someone tell me why this isn't working....???

Nevermind - I figured it out.

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Glad you figured it out. For those who may come later this was because 'en-ca' was being used as a string in a logical expression. It should use an IN expression or multiple logical expressions to compare for both 'en-us' or 'en-ca':

    CASE WHEN RIGHT(TRIM(`URL`),5) IN ('en-us', 'en-ca') THEN 'Yes' ELSE 'No' END
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Glad you figured it out. For those who may come later this was because 'en-ca' was being used as a string in a logical expression. It should use an IN expression or multiple logical expressions to compare for both 'en-us' or 'en-ca':

    CASE WHEN RIGHT(TRIM(`URL`),5) IN ('en-us', 'en-ca') THEN 'Yes' ELSE 'No' END
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • All I get is 0 and 1s when I use CASE WHEN and ask for true and false to be returned....wrapping whole thing in BOOLEAN() did stuff all as well....