Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

balajisj30
New Contributor III

Error while using Today() and now() for no. of days calculation

Hi People

I want to calculate no. of days for a claim to expire but when i use now() or today(), it throws an error.

qliksense today.PNG

1 Solution

Accepted Solutions
mato32188
Contributor III

Re: Error while using Today() and now() for no. of days calculation

Hi Balaji,

try to use parameter inside function.(http://help.qlik.com/en-US/sense/November2017/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/...)

Either 0, 1 or 2.

ExampleResult

now( 0)

Returns the time when the last data load completed.

now( 1)

  • When used in a visualization expression, this returns the time of the function call.
  • When used in a data load script, this returns the time of the function call in the current data load.

now( 2)

Returns the time when the app was opened.

BR

Martin

2 Replies
kuczynska
Contributor III

Re: Error while using Today() and now() for no. of days calculation

Hi,

Can you post the full expression? Both functions are quiet simple, I haven't come across many issues with neither of the functions so far.

As per Qlik guide:

Now()  ---- This function returns a timestamp of the current time from the system clock

Today() ---- This function returns the current date from the system clock.



mato32188
Contributor III

Re: Error while using Today() and now() for no. of days calculation

Hi Balaji,

try to use parameter inside function.(http://help.qlik.com/en-US/sense/November2017/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/...)

Either 0, 1 or 2.

ExampleResult

now( 0)

Returns the time when the last data load completed.

now( 1)

  • When used in a visualization expression, this returns the time of the function call.
  • When used in a data load script, this returns the time of the function call in the current data load.

now( 2)

Returns the time when the app was opened.

BR

Martin