Hello everyone,
I would like to find out if I can use the "Where" clause in preceding load statement to filter date?
Thanks
May be helpful
Hi Moses,
Could you explain a little bit your question?
I used a If condition to make it, buat y don´t know if it´s correct for you.
Regards
Miguel del Valle
Yes you can. Do you face any issues?
Definitely..
Yes...you can..
For your reference...
Tab1:
Load *,max(salary) as maxsal
where date='01/10/2017'
group by empname,Date;
Load empname,
Date,
salary
from----------(.txt);
Refer this https://www.tutorialspoint.com/qlikview/qlikview_preceding_load.htm
use where condition in first block
Hope resolves
Vikas
Ok, so what I am trying to achieve is to perform Incremental Load. Scenario below:
I have base QVD( Agentproductivity.qvd) and located in the folder, which has data for last 18 months and I have load new data for last 3 days everyday. So I have written a script like below
Temp1:
LOAD max(date(LastStatusUpdateDate,'M/D/YYYY h:mm:ss[.fff] TT')) as MaxLastUp
from $(vQVD)\AgentProductivity.qvd(qvd);
//Store the Maximum value of LaststatusUpdate in a variable.
LET MaxLastUp=Peek('MaxLastUp',-1);
drop Table Temp1;
ODBC CONNECT TO SQLSource;
Temp1:
LOAD
Reference,
LastStatusUpdateDate
where LastStatusUpdateDate> $(MaxLastUp);
SQL select
Reference,
datetime as LastStatusUpdateDate
from activity_lead al
where date(ai.datetime)>= DATE_SUB(NOW(),INTERVAL 3 DAY);
Make it like this (Single QUOTES)
where LastStatusUpdateDate> '$(MaxLastUp)';
Agree with vikasmahajan here, you should put the $(MaxLastUp) variable in the where clause of the SQL query, otherwise you will still be extracting more records than you need, even if they are filtered out in the preceding load.