Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
MartW
Partner - Specialist
Partner - Specialist

Datetime should be true but returns false

Goodday,

I've got an automation that runs fine for the most part but at december first this automation failed.

the failure was triggered by an condition block that checks an app reload time vs date and vs date - 1 day. (see 1ste screenshot)

MartW_0-1701686687851.png

The output of this block generated a false for the second part of the condition block. I don't understand why.

especially because the day after and the day before it ran oke.

The log show the following (this is the 1ste december run) see screenshot 2:

MartW_1-1701686940447.png

I would think that this will be set to true. 

Note that the block's output gives a true for both 30 november and 2nd december (and after that as well)

see logs (screenshot 3)

MartW_2-1701687083560.png

 

what can be the cause of this, how can I fix this? because I assume that this will error on 1st of januari 2024 as well and every 1ste of the month.

 

Labels (3)
1 Solution

Accepted Solutions
salmankojar
Partner - Creator II
Partner - Creator II

Problem is that your dates are in string format and comparison wont work properly on string format.As shown in your 2nd screenshot,it is comparing 30 and 01,which is why it is showing false for 30 < 01.

for this you have to change the format of date before comparing as shown in screenshot below.it will work perfectly.

In Date Output Format use "U" instead of "d-m-Y H:i:s" in all dates you are using.

View solution in original post

2 Replies
salmankojar
Partner - Creator II
Partner - Creator II

Problem is that your dates are in string format and comparison wont work properly on string format.As shown in your 2nd screenshot,it is comparing 30 and 01,which is why it is showing false for 30 < 01.

for this you have to change the format of date before comparing as shown in screenshot below.it will work perfectly.

In Date Output Format use "U" instead of "d-m-Y H:i:s" in all dates you are using.

MartW
Partner - Specialist
Partner - Specialist
Author

@salmankojar thx, this works. might be a handy thing to know from now on haha.