Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I've created a variable in using the variables interface to display todays date minus 30 days, called vToday:
When I output this variable to a text box there's no problem displaying the date (tho I need to format it to see the date rather than the numerical value of the date:
However, when I try to use this variable in set analysis, QlikSense displays no results. A hard coded date does:
The syntax I am using is:
count({$<Date={'>=22/02/2016'}>} AlarmCount)
count({$<Date={'>=$(vTodaysDate)'}>} AlarmCount)
In the data load editor my date format is set to SET DateFormat='DD/MM/YYYY'
It must be the formatting of the date in the variable, but I have tried date(Today()-30, 'DD/MM/YYYY') and there is no difference.
It's driving me mad...any help greatfully received.
Cheers
Neil
Can you try this:
Count({$<Date={'>=$(=$(vTodaysDate))'}>} AlarmCount)
or
Count({$<Date={'>=$(=Date($(vTodaysDate)))'}>} AlarmCount)
Can you try this:
Count({$<Date={'>=$(=$(vTodaysDate))'}>} AlarmCount)
or
Count({$<Date={'>=$(=Date($(vTodaysDate)))'}>} AlarmCount)
Thanks Sunny, that worked.
But what was interesting is this:
The first expression
Count({$<Date={'>=$(=$(vTodaysDate))'}>} AlarmCount)
Only worked where I had created my variable with formatting:
The second expression
Count({$<Date={'>=$(=Date($(vTodaysDate)))'}>} AlarmCount)
Still worked if my variable had both date formatting and no date formatting: Today()-30 or date(Today()-30, ‘DD/MM/YYYY’)
Date are something I feel Qlik Sense still doesn’t quite get right in variables.
Not sure but may be adding a equal sign within your variable might make a difference. One of those things, I am never comfortable with (variables)
Thanks @sunny_talwar that worked for me, but the syntax with variables is not very easy.