Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone!
So we have been working with Qlik Sense for a while now, and when we started to used to have the following expression in a KPI chart:
Count({<[ItemExpiryDate] = {"$(='<' & Date(Today()))"}>} distinct ItemID)
When we did a reload last week the value of the KPI chart is always equal to ZERO. We have checked the data and everything seems fine; however, I'd like to figure out why is Qlik Sense giving us this result. .
Your help is really appreciated,
hi
check in what format the field ItemExpiryDate
it's important that the date format in the set analysis will be similar to the one of the field ItemExpiryDate
Thanks for your reply. I believe nothing has changed since we first implemented this expression. Also when we re-wrote the expression as an IF Condition it worked like a charm.
Thanks!
The operator should be outside
Count({<[ItemExpiryDate] = {"<=$(=Date(Today()))"}>} distinct ItemID)
Thanks Vineeth! However, the expression doesn't work. it gives the total of items. In other words, it ignores the condition.
what format is ItemExpiryDate?
if it is DD/MM/YYYY format then you need to add it to the expression as below
Both comparing field and value have to be in same format.
Count({<[ItemExpiryDate] = {"<=$(=Date(Today(),'DD/MM/YYYY'))"}>} distinct ItemID)
The format is the default, as it has not been changed. As I mentioned before, it was working fine and even when we re-wrote it as an IF condition (without specifying the format). It works find. Also I have tried specifying the format and the result now is "-" instead of a ZERO.
What is your Default Format?
try this
Count({<[ItemExpiryDate] = {'<=$(Date(Today()))'}>} distinct ItemID)
or
Count({<[ItemExpiryDate] = {"<=$(Date(Today()))"}>} distinct ItemID)
SET DateFormat='M/D/YYYY';
I have tried both expressions and it gives the total (ignores the condition)
and the Format for [ItemExpiryDate] is it the same?