Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Loading data from a number of days

Hi,

I have the following script in my load script.

Calls:

Load   callref,

          logdate,

          userid,

Where logdate >= '01/01/2011'

Select callref,

          logdate

          userid

from     call_table

The above script loads the calls from the call_table for anything equal to or greater than the 01/01/2011.  However what I am looking to do is create the script so it picks up a number of days.  So therefore when I load my report, instead of it loading everything from 01/01/2011, it will load the last 1460 days.  Is this possible to do.

My logdate field is a TimeStamp format and shows as 01/01/2012 00:00:00, so if I try and convert to a number it shows something like 45986.2689898.

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions

Re: Loading data from a number of days

The "NUM" function converts date to equivalent numbers, in this way you can do something like this:

...

where num(mydate) >= num(today()) - 1446

Hope it helps

View solution in original post

1 Reply

Re: Loading data from a number of days

The "NUM" function converts date to equivalent numbers, in this way you can do something like this:

...

where num(mydate) >= num(today()) - 1446

Hope it helps

View solution in original post