4 Replies Latest reply: May 11, 2011 11:06 AM by Therese Liebermann RSS

    VBScript string functions in Qlikview?

      I am having a bit of a problem using some common string functions - instr and left, in particular.  I am reading in a variable value, and want to find the location of the dash in the string, and then display the first X number of characters in the string, up to the dash.

       

      For example:  variable = 334-545

      I want the message box to display 334

       

      My code is :

       

      set BandOne = ActiveDocument.Variables("Variable1").getContent
      set BandTwo = ActiveDocument.Variables("Variable2").getContent

       

      DashLoc = instr(1, BandOne, "-")
      msgbox(left(BandOne, DashLoc))

       

       

       

       

       

      The code is stopping on the DashLoc location, saying "type mismatch".  What am I doing wrong?

       

      Thanks