Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Time Cut Off

I'm very new at using Qlikview for our medical office to analyze medical data.  I am able to pull in dates from our sql database however, I am not sure how to condense the year to only pull records > 1/1/2014. Right now the data goes as far back as 1995 and is to much info to load.

Here are the table I'm using..

LOAD HDID,

    OBSDATE,

    Year (OBSDATE) as OBSYear,

    Month (OBSDATE) as OBSMonth,

    Weekday (OBSDATE) as OBSWeekDay,

    Day (OBSDATE) as OBSDay,

    Hour (OBSDATE) as OBSHour,

    OBSTYPE,

    OBSVALUE,

    PID;

SQL SELECT HDID,

    OBSDATE,

    OBSTYPE,

    OBSVALUE,

    PID

FROM xxx.xxx.OBS;

What is the best way to write this statement?

Tags (1)
1 Solution

Accepted Solutions

Re: Time Cut Off

Hi Nathan, try to add to SQL select statemet a Where clause to filter OBSDATE:

SQL SELECT HDID,

    OBSDATE,

    OBSTYPE,

    OBSVALUE,

    PID

FROM xxx.xxx.OBS WHERE OBSDATE>='01/01/2014';

Dates can be tricky and depending of the database source, the conditions the compare dates can differ.

3 Replies
MVP
MVP

Re: Time Cut Off

do you want records starting in 2014?

if yes and your database is sql server and OBSDATE is a datetime just add the bold

SQL SELECT HDID,

    OBSDATE,

    OBSTYPE,

    OBSVALUE,

    PID

FROM xxx.xxx.OBS

WHERE year(OBSDATE) >= 2014

;

Re: Time Cut Off

Hi Nathan, try to add to SQL select statemet a Where clause to filter OBSDATE:

SQL SELECT HDID,

    OBSDATE,

    OBSTYPE,

    OBSVALUE,

    PID

FROM xxx.xxx.OBS WHERE OBSDATE>='01/01/2014';

Dates can be tricky and depending of the database source, the conditions the compare dates can differ.

Not applicable

Re: Time Cut Off

Great thank you!