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
Chanty4u
MVP
MVP

try this

count(distinct{<LastConnectionTime={">=$(=(now()-7,'DD/MM/YYYY hh:mm:ss TT'))"},Source={'XXX'},FAU-={'redacted'}>} FAU)

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

count(distinct{<LastConnectionTime={">=$(=Date(now()-7,'DD/MM/YYYY hh:mm:ss TT'))"},Source={'XXX'},FAU-={'redacted'}>} FAU)

Thanks and Regards

Kashyap.R

Thanks and Regards
Kashyap.R
CreepyCatLady
Creator
Creator
Author

Thanks, but this doesn't make a difference. I still get a result of 0.

CreepyCatLady
Creator
Creator
Author

Thanks, but this doesn't make a difference. I still get a result of 0.

vinieme12
Champion III
Champion III

try below

count(distinct{<LastConnectionTime={">=timestamp(now()-7,'DD/MM/YYYY hh:mm:ss TT')"},Source={'XXX'},FAU-={'redacted'}>} FAU)

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

Thanks, but this doesn't make a difference. I still get a result of 0.

marcus_sommer

Your timestamp-field is left-aligned and therefore very likely a string and not a real timestamp. Just load it with something like:

timestamp(
   timestamp#(LastConnectionTime, 'FormatPatternSource'),
'FormatPatternTarget') as LastConnectionTime

- Marcus

Or
MVP
MVP

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

CreepyCatLady
Creator
Creator
Author

I had high hopes for this one, because my argument to the db guys was that the problem is that the field isn't a date field (their counter-argument was that it wasn't a date field before the server move and it worked before), but loading it with timestamp/timestamp# didn't work (I had already tried with date/date# and that didn't work either).