Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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?

1 Solution

Accepted Solutions
rubenmarin

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.

View solution in original post

3 Replies
maxgro
MVP
MVP

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

;

rubenmarin

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
Author

Great thank you!