Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: 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

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

Re: 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

Thanks Marcus !!!! It Helped !!!

Community Browser