Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I was trying to get the values of some measures for the current month and next 11 and used a date range to limit the caculation of the measures.
At first the numbers didn't seem to be right so after reviewing my expressions for a while, I found the culprit in the space in the second part of the date range. The results obtained up to that moment were equivalent of not having the second half of the expression:
[myDate]={">=$(=monthstart(today())) <= $(=monthend(addMonths(today(),11)))"}
After removing the space I started getting the right numbers
[myDate]={">=$(=monthstart(today())) <=$(=monthend(addMonths(today(),11)))"}
Is this the correct and expected behaviour of the set expression in Qlik Sense?
I don't recall any documentation mentioning the importance of not having a blank space there and it seems a bit counterintuitive to me.
Regards
It is consistent with how it works when you do a manual search in the "Selection Tool". If you put one or more spaces between the comparison operator(s) and a date you will not get a invalid search. Spaces between the first date and the operator(s) of a second date however does not matter. According to the documentation it seems like date searches fall under the category of numeric searches. The strange thing is that the same limitation with spaces between the comparison operator(s) does not apply to searches with normal numbers...
I agree it seems a little bit counter-intuitive and it is not documented in any way AFAIK.
It is consistent with how it works when you do a manual search in the "Selection Tool". If you put one or more spaces between the comparison operator(s) and a date you will not get a invalid search. Spaces between the first date and the operator(s) of a second date however does not matter. According to the documentation it seems like date searches fall under the category of numeric searches. The strange thing is that the same limitation with spaces between the comparison operator(s) does not apply to searches with normal numbers...
I agree it seems a little bit counter-intuitive and it is not documented in any way AFAIK.
Thank you for your answer Petter.
I tested your observation about the "Selection Tool" and could reproduce it.
It seems inconsistent that normal numbers accept the space but dates don't.
Going back to the the expression editor, maybe it could give a warning in these cases, to alert the user that part of the expression is being ignored.
Anyway, I don't know if posting here is the best way to get the attention from somebody within Qlik that could give us more insight.
Regards