1 Reply Latest reply on Apr 2, 2018 12:05 AM by Sankarmagesh Rajan

    IF Stmt error:  Expected closing parenthesis for the expression starting at character 4.

    FERDINAND SANCHEZ

      Greetings.

       

      New to Tableau interface.  Below if my code.  Getting error above.  Tried adding closing parenthesis but no luck.

       

      IF ([Trip] = 'RT' AND [AP] >= 14 AND [Departure Day] in ('Friday','Saturday') AND [Return Day] in ('Sunday','Monday') AND [LOS]) <= 3)

      THEN 'Planned Short Weekend Traveller RT'

      ELSEIF ([Trip] = 'RT' AND [AP] < 14 AND [Departure Day] in ('Friday','Saturday') AND [Return Day] in ('Sunday','Monday') AND [LOS] <= 3)

      THEN 'Impulse Short Weekend Traveller RT'

      ELSEIF ([Trip] = 'RT' AND [AP] >= 14 AND [Departure Day] in ('Wednesday','Thursday','Friday','Saturday') AND [Return Day] in ('Sunday','Monday','Tuesday') AND [LOS] in (4,5))

      THEN 'Planned Long Weekend Traveller RT'

      ELSEIF ([Trip] = 'RT' AND [AP] < 14 AND [Departure Day] in ('Wednesday','Thursday','Friday','Saturday') AND [Return Day] in ('Sunday','Monday','Tuesday') AND [LOS] in  (4,5))

      THEN 'Impulse Long Weekend Traveller RT'

      ELSEIF ([Trip] = 'OW' AND [AP] >= 14 AND [Departure Day] = 'Saturday')

      THEN 'Planned Weekend Traveller OW'

      ELSEIF ([Trip] = 'OW' AND [AP] < 14 AND [Departure Day] = 'Saturday')

      THEN 'Impulse Weekend Traveller OW'

      ELSE 'Other'

      END