6 Replies Latest reply: Dec 24, 2012 7:45 AM by Jeroen Jordaan RSS

    Place comma separated string value from Excel in a QlikView variable

    Jeroen Jordaan

      Hello everyone,

       

      I have a question and I think it should be very simple.

      I am developing a dashboard based on a Navision database.

      Some settings for the dashboard I place in an Excel file which I then load up in the script.

       

      In the Excel file I have 3 columns ID, Name and Value.

      The ID = 4, Name = InternalTTCodes, Values = TT115, TT330, TT365, TT400 etc.

       

      In the script I created a variable with a Peek function;

      LET vInternalTT = Peek('ExcelSetupValue', 4, 'ExcelSetup');

       

      When I created a textbox with the variable like this = vInternalTT I retrieve the values.

      Ony When I created a Set Analysis like this;

      =Sum({<ReasonCode = {'$(vInternalTT)'}>} VESalesAmountActual)

      I retrieve the value 0.

       

      Can some help me with this issue.

       

      Thank you in advance.

        • Re: Place comma separated string value from Excel in a QlikView variable
          Gysbert Wassenaar

          Does the ReasonCode field also contain comma separated values? Are you expecting ReasonCode = {'TT115, TT330, TT365, TT400'} or ReasonCode ={'TT115', 'TT330', 'TT365', 'TT400'}? The first is what you're getting. If you need the second you could split the Values field with the subfield function so you get a record for every value in the string and rename it to ReasonCode so it's associated the the other ReasonCode field. You can then use ID and Name in your set analysis expression instead to select the correct ReasonCodes.