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: 
NiklasV
Partner - Contributor
Partner - Contributor

Convert Date to Num in Automations

I need to have a numeric Date value to filter a report with, in Automations.
I'm able to create the first variable that holds a date using the "Date Formula", but I'm unable to convert it correctly into a numeric value with the second variable.
Tried using the "Convert Number Formula" but it returns 0.

Current Outcome:
Variable1: 2022-10-01 ->
Convert into Number ->
Variable2: 0

Expected Outcome:
Variable1: 2022-10-01 ->
Convert into Number ->
Variable2: 44839

Any ideas?

Labels (4)
1 Reply
blaise
Partner - Specialist
Partner - Specialist

There ought to be better ways but you can convert the data to unix time, divide with 86400 (no of seconds in a day) and add 25569 (serial number of unix start time - 1970-01-01).

{add: {divide: {date: {$.vDate}, 'U'}, 86400}, 25569}