Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
So $(vW1) in a text box isn't working? Do you have a equal sign before Min in the Variable Overview?
Yes, =$(vW1) is not working in text box.
If i write
=vW1
in a text box (to check if it is returning the correct value for vSelectedweek), It returns:
Min({< Data_Period = {'Weekly'},Formatted_Date = {'>'}>} Date,2);
looks like it is not able to calculate the variable vSelectedWeek. dont know how can i make it return the correct value?
What about this:
=$(=vW1)
If it still doesn't work, would you be able to share a sample?
hi Aditya,
Making use of 2 equal to signs should solve your issue and works the same in both Qlikview and Sense.
Check this document for more deeper insight:
Hi Sangram,
As per your suggestion, i tried below expression:
Set vW1 = = Min({< Data_Period = {'Weekly'},Formatted_Date = {'>$(=$(vSelectedWeek))'}>} Date,1);
and it is not working.
Hi Sunny, it is not working.