Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
alexandros17
Partner - Champion III
Partner - Champion III

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
alexandros17
Partner - Champion III
Partner - Champion III

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