Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to sum salaries depends on the date selected, so i have this:
I created a table in the script, like this:
Date_Table:
[Date_of_Job
"31-01-1999",
"25-03-2020"]
Then i created a variable:
Set vDate_Joob = '= Date_of_Job'
Then in the same script i created the variable to sum salaries
Set vsalary = sum({$<Date = $(vDate_Joob)>}salaries)
And then i have a filter with the dimension vDate_Joob, so the thing is when im using inside qlik the formula $(vSalary) it doesnt work, but if i use the formula instead of the variable (sum({$<Date = $(vDate_Joob)>}salaries)) it works!!. Anyone knows how can i change this? i need to use the variable not the formula
Thanks
Hi, $( is converted to the value inside the () when the script executes, and at that time it doesn't have any value, and if it had it will be a fixed value.
You can avoid that using replace(), like:
LET vsalary = Replace(sum({$<Date = #(vDate_Joob)>}salaries),'#','$');
Or load the expression from an external file, I can't find the post explaining this but is close to this answer: