Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
LastUpdatedDate:
Load
max(Date("TDate")) as MaxDate;
Let varLastExec = Date(Peek('MaxDate', 0, 'LastUpdatedDate'));
Let varThisExec = Date(Now());
M:
LOAD
TDate,
"ANO",
BILL,
PAY,
"SDATE",
"DNO",
ADJ,
COM,
Cheq,
"mk",
"user",
tkey,
place,
"icode",
pkey;
Concatenate
Load TDate,
"ANO",
BILL,
PAY,
"SDATE",
"DNO",
ADJ,
COM,
Cheq,
"mk",
"user",
tkey,
place,
"icode",
pkey from lib://QVDs/xyz.qvd
where not Exists(thekey);
inner join
load tkey;
sql select tkey from PAN.T;
if ('$(ScriptErrorCount)') = 0 then
Store M into [lib://QVDs/temp.qvd](qvd);
Let varLastExec = '$(varThisExec)';
endif
SQL SELECT
"TDate",
"ANO",
BILL,
PAY,
"SDATE",
"DNO",
ADJ,
COM,
Cheq,
"mk",
"user",
tkey,
place,
"icode",
pkey
FROM PAN.T
where date(TDate) <= #'$varLastExec'#;
I was trying for increamental load, but there is an error occured while script is loaded, Is the above script correct to perform increamental load ?
I have rectified that, It is showing the same error
Thank You, I'll check order of tables. But in link you have given it is for excel data, can i have something similiar for sql data?
Hi,
If possible, can you post your qvf and qvd...
Regards
Can I send the script in word file. Anyways sending the .qvf file won't execute since it is ODBC connected with my server
ok np..
but explain what issue you are still facing??
like data is not loading or getting error or anything so that I can help you in more better way to solve it..
Regards
Ya sure I'll say it one by one. 1st error I'm facing is
SQL select * from POM.T
where date(TDate) <= #('$(varLastExec)')#;
Error Displayed is :
Started loading data
Connecting to Alocal Connected
The following error occurred:
Connector reply error: SQL##f - SqlState: 37000, ErrorCode: 4294967165, ErrorMsg: [Sybase][ODBC Driver][SQL Anywhere]Syntax error near '#' on line 20
The error occurred here:
?
It suggest SQL error.
What I understand from this You are combining qlik script (Syntax) with sql script
Try like
Load * where date(TDate) <= '$(varLastExec)';
SQL select * from POM.T;
Regards
But can I use Qlik script variable inside a sql statement? Because I want to limit the data getting select from sql itself, instead of limiting it in the load.
the procedure is the same, you should only change your table from sql
Max Payne, Thanks for your support i have solved that issue