4 Replies Latest reply on Jan 15, 2017 2:15 PM by Chris McClellan

    expected then to match if at character 0

    Fabrizio Laconi

      Hi

       

      I am getting this response: expected then to match if at character 0

       

      Not sure what that means... the one below is my statement:

       

       

      IF CONTAINS(UPPER([Property Rate Name])),"EXCITE" THEN "Excite Holidays"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"AGODA" THEN "Agoda"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"BOOKING.COM" THEN "Booking.com"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"EXPEDIA" THEN "Expedia"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"WOTIF" THEN "Expedia"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"ORBITZ" THEN "Expedia"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"YATRA.COM" THEN "Yatra.com"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"ELONG" THEN "Elong"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"CTRIP" THEN "Ctrip"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"MAKEMYTRIP" THEN "MakeMyTrip"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"CLEARTRIP" THEN "ClearTrip"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"TRAVELGURU" THEN "TravelGuru"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"GOIBIBO" THEN "Goibibo"

      ELSEIF CONTAINS (UPPER([Property Rate Name])),"FLIGHT CENTRE" THEN "Flight Centre"

      ELSE "Non-OTA"

      END

       

      Where am I going wrong?

       

      Thanks,

       

      Fabrizio

        • 1. Re: expected then to match if at character 0
          Curtis Harris

          Looks like your contains statement is getting closed too early... I'd guess that is the problem even though the error doesn't suggest so. Move the second right paren to the right of your first string and see what happens. Curtis

          • 2. Re: expected then to match if at character 0
            Chris McClellan

            Definitely a syntax error, try this :

             

            CONTAINS(UPPER([Property Rate Name]),"EXCITE")

             

            format on every line (as Curtis said)

            • 3. Re: expected then to match if at character 0
              Fabrizio Laconi

              Thank you so much!

               

              It now works... now I am trying to improve the statement.

               

              IF CONTAINS(UPPER([Property Rate Name]),"EXCITE") THEN "Excite Holidays"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"AGODA") THEN "Agoda"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"BOOKING.COM") THEN "Booking.com"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"EXPEDIA") THEN "Expedia"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"WOTIF") THEN "Expedia"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"HOTELS.COM") THEN "Expedia"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"ORBITZ") THEN "Expedia"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"YATRA.COM") THEN "Yatra.com"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"ELONG") THEN "Elong"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"CTRIP") THEN "Ctrip"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"MAKEMYTRIP") THEN "MakeMyTrip"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"MAKE MY TRIP") THEN "MakeMyTrip"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"CLEARTRIP") THEN "ClearTrip"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"CLEAR TRIP") THEN "ClearTrip"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"QUNAR") THEN "Qunar"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"VERYCHIC") THEN "VERYCHIC"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"17U") THEN "17U"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"RAKUTEN") THEN "Rakuten"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"TRAVELGURU") THEN "TravelGuru"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"GOIBIBO") THEN "Goibibo"

              ELSEIF CONTAINS(UPPER([Property Rate Name]),"FLIGHT CENTRE") THEN"Flight Centre"

              ELSEIF CONTAINS(UPPER([Property Rate Code]),"Y-GTA") THEN "gta"

              ELSEIF CONTAINS(UPPER([Property Rate Code]),"Y-HRS") THEN "HRS"

              ELSEIF CONTAINS(UPPER([Property Rate Code]),"Y-“) THEN "Other OTA"

              ELSE Other"

              END

               

               

              But I get the response that the statement contains un-terminated string. Not sure which one...

              • 4. Re: expected then to match if at character 0
                Chris McClellan

                It's really a different forum post because it's a different question, but you've missed a quote in the ELSE condition .... "Other" doesn't have a quote at the start.