1 Reply Latest reply: Apr 11, 2018 2:35 PM by Petter Skjolden RSS

    qsvariable with dynamic values

    Jill Woodley

      Wondered if anyone can help - I've searched the community and while I find many posts i cant find one that resolves my problem.

       

      My data is organised by date for example:

       

      12/01/2018,data1,data2,data3

      12/01/2018,data1,data2,data3

      12/02/2018,data1,data2,data3

      12/02/2018,data1,data2,data3

      12/03/2018,data1,data2,data3


      Next month the table grows and I get new rows for the following month.


      I want the page to open with the latest month's data on show but for the user to be able to select a previous months data if they wish.


      I have this all working using the extension qsVariable, and set analysis using this variable but I have to go in every month and add the new values for the new date and I am looking for a way to automate this.

      I have looked at using the extension qliksenselistbox but this makes a real selection and I only want to set a variable as I have other sheets that are similar but use different dates. In fact I have 4 different sheets all using different dates which is why I want to automate it.


      I have seen that the qsvariable has a dynamic setting in values Value1|Value2 - but i do not know how to create the expression that would create 12/03/2018|12/02/2018|12/01/2018 from my table. I don't think I can use peek as I don't know how many different dates i will have in the table so cant set the row number


      If anyone has any ideas how i can create the dynamic expression, or any other way of achieving this i'd be most grateful.


      Many thanks,

      Jill




        • Re: qsvariable with dynamic values
          Petter Skjolden

          I would recommend that you consider having an extra date field that is relative to today. You can call it DaysAgo.

           

          0 is always today. 1 would be yesterday .... and so forth.

           

          The beauty of this is that as long as you fix DaysAgo to be 0 it will always be current. You could of course create additional xxxxAgo fields for Months, Quarters, Weeks and Years too if you need.

           

          This would make your problem disappear as you don't need to dynamically update your selections.