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

External data that I want to read has a date column, I want rows where date is Yesterday date, all rows that have last week date, all rows that have last month date..how to do it in Qlikview script? please note, my database is in SQL server

external data that I want to read has a date column, I want rows where date is Yesterday date, all rows that have last week date, all rows that have last month date..how to do it in Qlikview script? please note, my database is in SQL server

Need help asap

Thanks in Advance

my script is

OLEDB Connect to [provider=SQLOLEDB.1.................................................]

SQL SELECT *

FROM 'abc.DBO.'XYZ' ;

2 Replies
marcus_sommer

If your table isn't very huge you could use a where-clause within a Preceding Load like:

Load *

where Date = date(today()-1) or

           Date = date(floor(weekstart(today())-1) or

           Date = date(floor(monthstart(today())-1);

SQL SELECT *

FROM 'abc.DBO.'XYZ' ;

I think the same main-logic (with other functions and probably more efforts) could be applied to the sql-statement when the sql-load is too heavy without filtering.

- Marcus

Not applicable
Author

Thanks Marcus !!!! It Helped !!!