Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

KPI Expression Doesn't Work Anymore?

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,

13 Replies
lironbaram
Partner - Master III
Partner - Master III

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

Anonymous
Not applicable
Author

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!

vinieme12
Champion III
Champion III

The operator should be outside


Count({<[ItemExpiryDate] = {"<=$(=Date(Today()))"}>} distinct ItemID)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thanks Vineeth! However, the expression doesn't work. it gives the total of items. In other words, it ignores the condition.

vinieme12
Champion III
Champion III

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)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

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.

vinieme12
Champion III
Champion III

What is your Default Format?

try this

Count({<[ItemExpiryDate] = {'<=$(Date(Today()))'}>} distinct ItemID)

or

Count({<[ItemExpiryDate] = {"<=$(Date(Today()))"}>} distinct ItemID)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

SET DateFormat='M/D/YYYY';

I have tried both expressions and it gives the total (ignores the condition)

vinieme12
Champion III
Champion III

and the Format for [ItemExpiryDate]  is it the same?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.