8 Replies Latest reply: Jun 20, 2018 8:22 AM by Øystein Kolsrud RSS

    How do I define list with single value in script?

    Øystein Kolsrud

      I have a list variable in a Qlik Sense script that is used to configure a set of values the script will iterate over. I implemented the script like this:

       

      SET vList = 'Value1', 'Value2';
      
      FOR EACH element IN $(vList)
           TRACE Element is: $(element);
      NEXT element;
      

       

      This works fine and the trace method is called twice, once for each value in the list. However, I have not found a way to declare vList so that it holds a list of just one value. If I set vList like this:

       

      SET vList = 'Value1';
      

       

      Then all I get is an empty string. How would I define such a single value list? And related, how would I define an empty list?