Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Load from multiple daily extracts

Hi,

I am loading (concatenating) the same daily application extract into QV every single day. At the moment I copy and paste the entire load script for the extract, then I simply put the name of the new day’s extract in the FROM statement. This means my script is increasing in size exponentially every day.

Is there any way to just load the same fields and then type in the name of all the extracts in the FROM statement?

For instance:

Load Field1

           Field1

           Etc.

FROM Extract_Day_1

Concatenate Load Field1

Field1

           Field1

           Etc.

FROM Extract_Day_1 AND Extract_Day_2 AND Extract_Day_3 AND Extract_Day_4 AND Extract_Day_5 etc.

Thanks,

Gerhard

3 Replies
Anonymous
Not applicable

HI try something like the code below:

DAYS:

LOAD * INLINE [

    daynr

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

];

For i = 0 to 9

Let vDays =  Peek('daynr','$(i)','DAYS');

Data:

LOAD *

FROM Extract_Day_$(vDays)

;

next i

Drop Table DAYS;

I think you need to adjust it a bit but the idea is that you create a loop in the loading script.

Hope this is helpfull for you.

gerhardl
Creator II
Creator II
Author

Hi,

Wow – that is Greek to me to be honest…

My file names are as follows:

Daily_ApplicationExtract_A_30-MAY-2011_31052011012554.txt i.e. Daily_ApplicationExtract_A_DD-MMM-YYYY_DDMMYYYYhhmmss.txt

Please could you explain what you just said about the loop using the filenames as above?

Much appreciated,

G

Gerhard Laubscher

Tenacity (a Pepkor company)

P.O. Box 6387, Parow East, 7501, South Africa

T: +27 (0)21 928 1017

F: +27 (0)21 928 1012

C: +27 (0)82 080 4190

www.tenacityinc.co.za<http://www.tenacityinc.co.za/>

gerhardl@tenacityinc.co.za<mailto:stephnik@tenacityinc.co.za

gerhardl
Creator II
Creator II
Author

Figured it out – all I did was this:

http://qlikcommunity.org/forums/t/21965.aspx

Thanks,