Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Loop load

Hi everyone. 

I have a folder with some amount of .qvds. Each file in this folder has a name like "Sub_YYYYMMDD". For each new day I have one new qvd with name that ends with a date when file was loaded (as example Sub_20200622) . 

When I need to load all files from the folder I use next loop 

TMP:
load * Inline [File_FK];

For Each File in Filelist('Folder\*.qvd')

Concatenate (TMP) Load * From [$(File)](qvd);

Next File

 

But also I need to load only part of the files I have in this folder. Lets say I need files that was loaded for the last 10 days till today. In other words I need to load files with names from 20200617 till 20200626. And I don't  understand how to put  this condition in the loop.  Need your help to understand how this condition may be implemented?

1 Solution

Accepted Solutions
Master II
Master II

Hi,

Maye be this version :

TMP:
load * Inline [File_FK];

For Each File in Filelist('Folder\*.qvd')

let vFlag=Floor(Date(today())-Date(Date#(left(right('$(File)',12),8),'YYYYMMDD')));
	
	if $(vFlag)<=10 then
		
		Concatenate (TMP)
		
		Load * From [$(File)](qvd);
	
	endif

Next File

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Master II
Master II

Hi,

Maye be this version :

TMP:
load * Inline [File_FK];

For Each File in Filelist('Folder\*.qvd')

let vFlag=Floor(Date(today())-Date(Date#(left(right('$(File)',12),8),'YYYYMMDD')));
	
	if $(vFlag)<=10 then
		
		Concatenate (TMP)
		
		Load * From [$(File)](qvd);
	
	endif

Next File

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

Creator II
Creator II

@Taoufiq_Zarra  Thank you. Your idea is helpful.