Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Preceding load error in Incremental load

Hi,Qlikers

for incremental load

after reading the data from qvd Created one variable and storing the max date in that variable

like vMax=peek('Date',-1,Temp);

and after that i connected to sql server and written  presceding load some thing like

Incremental:

LOAD *,Date(Floor( TimeData)) as Date;

SQL SELECT *

FROM Emp

Where Date>=$(vMax);

but it is giving error message

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Invalid column name 'Date'.

SQL SELECT *

FROM Emp

Where Date>=9/12/2015

could any one have idea about this

please help me

thanks in advanse

regards,

hemesh

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Try

Where TimeData >= '$(vMax)';

View solution in original post

5 Replies
MK_QSL
MVP
MVP

1)

vMax=peek('Date',-1,'Temp');     // You missed single quotes for Temp

Incremental:

LOAD *,Date(Floor( TimeData)) as Date;

SQL SELECT *

FROM Emp

Where Date>='$(vMax)';                              // $(vMax) should be '$(vMax)'

Not applicable
Author

still it is showing

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Invalid column name 'Date'.

SQL SELECT *

FROM Emp

Where Date>='9/12/2015'

By the time of executing the records are same in qvd and

Incremental:

LOAD *,Date(Floor( TimeData)) as Date;

SQL SELECT *

FROM Emp

Where Date>=$(vMax);

is this because of that

MK_QSL
MVP
MVP

Try

Where TimeData >= '$(vMax)';

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

This is telling you that the field Date does not exist in the table Emp.

Go back to your table in SQL Management Console and check the fields.  Given your load statement I think MRKachhiaIMP‌ is probably correct.

Whatever goes into your SQL statement must execute correctly when copied and pasted into management studio.

For that reason, you probably need to format your vMax variable accordingly also, depending on the setup of your SQL Server, perhaps:

vMax= Date(peek('Date',-1,'Temp'), 'YYYY-MM-DD hh:mm:ss.fff');


Another point of note, using Peek -1 you need to be 100% confident that the date on the last row is the one you need to load from.  If you are enforcing this with an ORDER BY in the QVD load you will be causing it to be non-optimised and it will therefore be slow anyway - kind of removing the point of an incremental load.


This post has more on incremental loads:

http://www.quickintelligence.co.uk/qlikview-incremental-load/


Steve

Not applicable
Author

Now i am getting thank you manish