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.
amithmurali
Contributor

Filter Date while Loading From Database

Hi guys,

I have a Problem in my DB. When i load the data from 2014. in some places, because of the user error. there some dates like 2090,2030 etc and also months.

How to filter data while loading from 2014 jan 1st to Todays date.

This is the filter which i used while loading the data to get data from 2014 jan1st.

FROM cmsdhcc.dbo."department_income_view"  where YEAR("d_date") >=2014;

1 Solution

Accepted Solutions
crusader_
Valued Contributor

Re: Filter Date while Loading From Database

Hi,

You can add where filter in your SQL statement smth like below:

where YEAR("d_date") >=2014 and "d_date"<=GETDATE(); - example for SQL server


or

You can filter out in your LOAD satement:

LOAD *

Where date(d_date)<=today()

;

SQL SELECT ...


Hope this helps you.


Regards,

Andrei

2 Replies
crusader_
Valued Contributor

Re: Filter Date while Loading From Database

Hi,

You can add where filter in your SQL statement smth like below:

where YEAR("d_date") >=2014 and "d_date"<=GETDATE(); - example for SQL server


or

You can filter out in your LOAD satement:

LOAD *

Where date(d_date)<=today()

;

SQL SELECT ...


Hope this helps you.


Regards,

Andrei

Re: Filter Date while Loading From Database

Hi,

Use and trunc(d_date)<=trunc(sysdate())

try below

FROM cmsdhcc.dbo."department_income_view"  where YEAR("d_date") >=2014 and trunc(d_date)<=trunc(sysdate());

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Community Browser