Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pabloviera
Creator
Creator

Set analysis with date ranges, intended behaviour or bug?

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

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

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.

View solution in original post

2 Replies
petter
Partner - Champion III
Partner - Champion III

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.

pabloviera
Creator
Creator
Author

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