Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
niccolo24
New Contributor II

Define system date in script

Hi,

how can i set the system date to a date of my choosing?

For example:

SET SYSDATE = '09/09/2014'

in order that Today() = 09/09/2014

Tx

6 Replies
neetha_p
Honored Contributor

Re: Define system date in script

Hi Niccolo,

Do you mean formatting of system date.

If  so please check below:

LET vStartDate = date(today(),'DD-MM-YYYY');

Regards

Neetha

Re: Define system date in script

Hi,

If you want to set your start date or make your choosing today date then write a variable like

Let vToday  = Date('09/09/2014','DD/MM/YYYY')

Regards

Anand

niccolo24
New Contributor II

Re: Define system date in script

Hi,

something similar to that: but i am not using a variable vToday, but i am using the function today().

I guess that the date that is referred to today() is some kind of sys date that i need to modify.

How do i do that?

tx

MVP
MVP

Re: Define system date in script

- you can set a variable at the date you want (as Anand suggested)

- but can't change the result of today() function because it use the system clock (well if you change your computer date / time you can)

today([timer_mode] )

Returns the current date from the system clock. The timer_mode may have the following values:

0 Date at script run
1 Date at function call
2 Date when the document was opened  

Re: Define system date in script

Hi,

No i think that is not possible when use Today() or Now() they returns the system today date and time. But if you need the 09/09/2014 exactly for today date in the date model then use variable and use Addmonth( ) function to get date dynamically.

Regards

Anand

Re: Define system date in script

I guess you want to do this for testing using QV Desktop.

If that is the case then have a look at the RunAsDate utility, Google it and you'll find it.

Community Browser