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: 
paulyeo11
Master
Master

Case 909 How to apply partial reload with FOR i function ?

Hi All

I have below script , Part (A) work fine. But Part (B) not working , because it only load 1 raw data file , it should load 2 raw data file.

SET vRAWPath = 'C:\Users\pauly\Dropbox\QV_RAW_ISDN\'; //local folder

// Part (A)

For Each i in 'PM','SD'
Data:
LOAD
'$(i)' as SOURCE,
[Sales Person] AS Sales_Person,
[Opportunity Name] AS Opportunity_Name,
[Company Name] AS Company_Name,
[Contact Person] AS Contact_Person,
[Opportunity Closing Date] AS Closing_Date,
[Opportunity Closing Date],
[Opportunity Starting Date] AS Starting_Date,
[Opportunity Amount] AS Opp_Amount,
[Stage of Opportunity] AS Stage,
[Probability %] AS Probability,
[Opportunity Number] AS Opp_number
FROM
$(vRAWPath)CRM_$(i).CSV
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
NEXT i;

//Part (B)

left join(Data)
load date(max([Opportunity Closing Date])) as [Opportunity Closing Date],
1 as Latest_Date_Flag
resident Data;

My question is how to apply FOR and i at above script ? So that it will load twice.

I have try below , it does not work :-

For Each i in 'PM','SD'

left join(Data)

'$(i)' as SOURCE,
load date(max([Opportunity Closing Date])) as [Opportunity Closing Date],
1 as Latest_Date_Flag
resident Data;

NEXT i;

 

Paul

 

1 Reply
Brett_Bleess
Former Employee
Former Employee

Only thing of which I can think is the following:

https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.