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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date manipulation

Is there any variable or function in QlikView that returns the current system date,time?

Then id like to subtract the current date with a give date and return the number of days.

Any idea on how this can be done?

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sure. Try now() or localtime(). Keep in mind that they poll the system every second for the time though.

You might want to do now(2) to pull the time when the document was opened.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Sure. Try now() or localtime(). Keep in mind that they poll the system every second for the time though.

You might want to do now(2) to pull the time when the document was opened.

Not applicable
Author

thank you. i've just edited the post. can you answer my second question too?

Anonymous
Not applicable
Author

If you only want the number of days you can use:

=today() - YourDate

This assumes that you've provided your date in a date formatted way, the way specified in the script under DateFormat.

If you want to enter a date into a variable you can use:

=Today() - $(VariableName)

If your date contains a time section too the result will have a decimal part indicating the time of the day. This can be removed by using the floor() function around the expression:

=Floor(Today() - $(VariableName))