Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
CTH2022
Contributor
Contributor

Expression compare Date in KPI chart

I'm really new in Qlik 

I just want to count only item that already end of warantee

I use KPI chart with below expression , [tIVT.endWarantee] is date in value.

=Count({<date([tIVT.endWarantee],'DD/MM/YYYY')={"$(='>'&today())"}>} [tIVT.Item])

Could someone suggest me for this case please?

Labels (2)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@CTH2022  See what I have done using your data. First I converted the WarrentENDDate to proper date format show like below:

NoConcatenate
Temp:
Load ITemNo,Date(WarrentyEndDate,'MM/DD/YYYY') as WarrentyEndDate
Inline [
WarrentyEndDate, ITemNo
43019,1
43044,2
43077,3
43174,4
43343,5
43454,6
43456,7
44766,8
44765,9
44768,10
44769,11
];

Exit Script;

In the above I have 2 Dates that I greater than today.

In the Front end I used the below expression and it gave me right result.

Count({<WarrentyEndDate={">=$(=Today())"}>}ITemNo)

If this does not resolve your issue, please let me know.

View solution in original post

6 Replies
sidhiq91
Specialist II
Specialist II

@CTH2022  It should be  just as below expression:

count({<[tIVT.endWarantee]={">=$(=today())"}>}[tIVT.Item])

Adjust the [tIVT.endWarantee] date format to 'DD/MM/YYYY' in the script itself

If this resolves the issue please like and accept it as a solution.

CTH2022
Contributor
Contributor
Author

I try as suggestion it's look better than my expression which return "-".

But above expression always retun "0" even I try, > , < , =  


sidhiq91
Specialist II
Specialist II

@CTH2022  Could you please tell in which format is your [tIVT.endWarantee] date?

Sometimes the difference in date format could also result in such things. 

Or if you can provide me some sample data, I can clear your issue rightaway.

CTH2022
Contributor
Contributor
Author

My date is date value as shown in table chart.

CTH2022_0-1658724809493.png

 

sidhiq91
Specialist II
Specialist II

@CTH2022  See what I have done using your data. First I converted the WarrentENDDate to proper date format show like below:

NoConcatenate
Temp:
Load ITemNo,Date(WarrentyEndDate,'MM/DD/YYYY') as WarrentyEndDate
Inline [
WarrentyEndDate, ITemNo
43019,1
43044,2
43077,3
43174,4
43343,5
43454,6
43456,7
44766,8
44765,9
44768,10
44769,11
];

Exit Script;

In the above I have 2 Dates that I greater than today.

In the Front end I used the below expression and it gave me right result.

Count({<WarrentyEndDate={">=$(=Today())"}>}ITemNo)

If this does not resolve your issue, please let me know.

CTH2022
Contributor
Contributor
Author

This sloved!!!
Prepare date value in proper date format before compare with today().

Many thanks.