Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where clause in preceding load

Hello everyone,

I would like to find out if I can use the "Where" clause  in preceding load statement to filter date?

Thanks

11 Replies
Anil_Babu_Samineni

May be helpful

Preceding Load

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
migueldelval
Specialist
Specialist

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

tresesco
MVP
MVP

Yes you can. Do you face any issues?

robert_mika
Master III
Master III

Definitely..

surendraj
Specialist
Specialist

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);

vikasmahajan

Refer this https://www.tutorialspoint.com/qlikview/qlikview_preceding_load.htm

use where condition in first block

Hope resolves

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

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);

Not applicable
Author

Make it like this   (Single QUOTES)

where LastStatusUpdateDate> '$(MaxLastUp)';

cmsjamesgreen
Contributor III
Contributor III

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.