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

Dynamic script for file path

Hi Community,

I have little problem creating dynamic path for my application. I want to have a dynamic script which will pull the xyz.log file from each path where the folder is just changing. Please see below for the sample paths.

The values for variables (i.e. India,US,UK etc.) are coming from an spreadsheet. I want to use For loop for pulling into variables for path.

\\qlikviewprod\Apps\India\xyz.log

\\qlikviewprod\Apps\US\xyz.log

\\qlikviewprod\Apps\UK\xyz.log

etc.

Any help is much appreciated.

1 Solution

Accepted Solutions
hector
Specialist
Specialist

Hi,

use peek() or fieldvalue for the loop


Country:
LOAD * INLINE [
Country
India
US
UK
];

Let n = NoOfRows('Country');
For i = 1 to n
Let vCountry = fieldvalue('Country',i);
Files:
Load
field
from '\\qlikviewprod\Apps\$(vCountry)\xyz.log' ; //at least here, load one log just to check how this line is created for your file, then replace the region with the variable
next


Rgds

View solution in original post

2 Replies
hector
Specialist
Specialist

Hi,

use peek() or fieldvalue for the loop


Country:
LOAD * INLINE [
Country
India
US
UK
];

Let n = NoOfRows('Country');
For i = 1 to n
Let vCountry = fieldvalue('Country',i);
Files:
Load
field
from '\\qlikviewprod\Apps\$(vCountry)\xyz.log' ; //at least here, load one log just to check how this line is created for your file, then replace the region with the variable
next


Rgds

montubhardwaj
Specialist
Specialist
Author

Perfect Hector. Helped like Hector in "TROY" Big Smile

Many thanks.