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

Incremental Load issue

Hi Everyone,

                I am getting error at the last line( Where Condition Load_Date>=$(VbuiMstr)),

Any suggestions would be greatly appreciated.

D_GIS_BUILDING_MSTR:
LOAD COMPANY_CODE,
OFFICE_CODE,
CITY_CODE,
OFFICE_NAME,
Date(Load_Date) as Load_Date ,
Load_DateTime
FROM
[..\Data Sources\Master\D_GIS_BUILDING_MSTR.qvd]
(
qvd);

LET VbuiMstr=Peek('Load_Date',0,'D_GIS_BUILDING_MSTR');
//Let Vtodayt=Today()-1;

Incr_D_GIS_BUILDING_MSTR:
NoConcatenate
SQL SELECT *
FROM HRAnt.dbo."BUILDING_MSTR" where COMPANY_CODE='C002' and Load_Date>=
$(VbuiMstr);

Thanks in Advance

Regards,

P.Divya

1 Solution

Accepted Solutions
MVP
MVP

Re: Incremental Load issue

You should format the date field to match what your database expects in a date. And enclose in single quotes. Something like

LET VbuiMstr = Date(Peek('Load_Date',0,'D_GIS_BUILDING_MSTR'), 'DD-MM-YYYY');


(adjust the format string to your requirements)


Your screenshot is too small to be able to read the error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
9 Replies
MVP
MVP

Re: Incremental Load issue

Try with single quotes around dollar expansion like:

Load_Date>='$(VbuiMstr)' ;

Not applicable

Re: Incremental Load issue

Hi tresesco,

Thanks for quick response,I tried with single quotes ,but still it is giving error

Not applicable

Re: Incremental Load issue

Hi ,

Please find below screenshot for your reference

MVP
MVP

Re: Incremental Load issue

You should format the date field to match what your database expects in a date. And enclose in single quotes. Something like

LET VbuiMstr = Date(Peek('Load_Date',0,'D_GIS_BUILDING_MSTR'), 'DD-MM-YYYY');


(adjust the format string to your requirements)


Your screenshot is too small to be able to read the error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Incremental Load issue

Hi ,

PFA

MVP
MVP

Re: Incremental Load issue

ODBC fail. Have you tried without this where clause, is that working?

MVP
MVP

Re: Incremental Load issue

That looks like a login/permissions issue.

I suggest that you test the ODBC connection again. In the script editor, just create a new ODBC connection and click the test option (delete the newly created connection when done)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
prashantbaste
Contributor II

Re: Incremental Load issue

Hi,

Please check with below code -

//-------------------------------------------------------------------------

D_GIS_BUILDING_MSTR:
LOAD COMPANY_CODE,
OFFICE_CODE,
CITY_CODE,
OFFICE_NAME,
Load_Date as Load_Date ,
Load_DateTime
FROM
[..\Data Sources\Master\D_GIS_BUILDING_MSTR.qvd]
(
qvd);

LET VbuiMstr=Peek('Load_Date',0,'D_GIS_BUILDING_MSTR');
//Let Vtodayt=Today()-1;

Incr_D_GIS_BUILDING_MSTR:
NoConcatenate
SQL SELECT *
FROM HRAnt.dbo."BUILDING_MSTR" where COMPANY_CODE='C002' and Load_Date>=
$(VbuiMstr);

//-------------------------------------------------------------------------


There is possibility of datatype mismatch in database field & value stored in variable. Better not to format field.


Please check & confirm if it resolves your query.


--

Regards,

Prashant  P Baste

Not applicable

Re: Incremental Load issue

Hi tresesco,

Your information is also very helpful.Thanks for your Valuable information.

Regards,

P.Divya