7 Replies Latest reply: Jan 12, 2016 1:41 PM by mrtransformer mrtransformer RSS

    Storing a Value of a Set analysis expression in a Variable

    mrtransformer mrtransformer

      Hi Guys,

       

      I am new to Qlik and struggling with storing  a set analysis expression's value in a variable.

       

      I want to store below expression's value in a variable so that i can use that further for some calculations.

       

      Min({< Data_Period = {'Weekly'},Formatted_Date = {'>$(=$(vSelectedWeek))'}>} Date,2)

       

      The above expression works fine if i use it in a text box on a sheet tab. However, it is not working if i try to store its value in a variable and use that variable.

       

      Set vW1 = Min({< Data_Period = {'Weekly'},Formatted_Date = {'>$(=$(vSelectedWeek))'}>} Date,2);


      Here  vSelectedWeek  is being calculated as follows:


        Set vSelectedWeek = Date(Weekstart(Only(BaseData_Date)),'dd/MM/YYYY');


      Please advise if i am doing anything wrong or is there any other way around to achieve the same?

      Thanks in advance.