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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
CreepyCatLady
Creator
Creator

"now" function not working

I have an app where I am using the "now" function to find activity for specific machines over the last 7 days. It has been working properly for two years and now for some reason it is broken. I can't figure out for the life of me why it is not working.

The function is:

count(distinct{<LastConnectionTime={">=$(=(now()-7))"},Source={'XXX'},FAU-={'redacted'}>} FAU)

This is now returning a result of 0; however, in my details table from the same data source, there are many results with LastConnectionTime in the last 7 days.

CreepyCatLady_0-1648674912764.png

 

Does anyone have any ideas why this isn't working anymore?

Labels (2)
12 Replies
CreepyCatLady
Creator
Creator
Author


@Or wrote:

Does it work correctly if you use Now(1) instead of Now()?


It does not. 

Or
MVP
MVP

Ah, so it's not an issue with now() itself (I've had this happen occasionally where now() returns unexpected values due to caching or whatnot).

You should be able to check if the field is being read as a date by using any date function on it e.g. Month(LastConnectionTime) or any other date function. If it is not, you will need to find a way to convert it to a date, which is indeed done through timestamp#() - in your case I think the pattern should be:

timestamp#(LastConnectionTime, 'M/DD/YYYY h:mm:ss TT')

 

marcus_sommer

A converting with timestamp# will work if the applied format-pattern is suitable - means it must be exactly fit for each single char. An alternatively might be to add respectively to adjust the interpreting variables which are usually at the beginning of the script but they could be also changed multiple times within the script. Again the format-pattern must be suitable.

- Marcus