Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vittorianad
Contributor III
Contributor III

Load Data using GetfolderPath() function

Hi guys,

I'm trying to load data from files stored  into a server shared directory, whose path is clearly differentent from user to user.

I'm actualy using this:

DIRECTORY ;

for each File in filelist('*.xlsx')

LOAD *

FROM

[$(File)]

(ooxml, embedded labels, header is 1 lines, table is Contatti); 

next File;

it works... ok

The problem is that one of my collegue has to change the directory to it's own path

DIRECTORY ;

to make it works.


Is there any set of instructions to set the path dinamicaly?

I tried with

load

   Getfolderpath('DashBoard') as dropBox

   AutoGenerate 1;

DIRECTORY [$(dropBox)\Contatti\Piani];


but doesnt'work...

any suggestion?

thanks to all

11 Replies
ali_hijazi
Partner - Master II
Partner - Master II

then you can directly read from xlsx in the script as follows:

load *

from Piani\name_of_excel_file

you don't need to go to root then access folder; it is already near the qvw file

I can walk on water when it freezes
richard_blakemore
Partner - Contributor III
Partner - Contributor III

Hi

I use a variable set up i.e.

Set vUser= 1;  // 1 = Bob, 2 = John

if $(vUser) = 1

     Let vFolderPath = '\\Bob Server\Bob directory\';

ElseIf $(vUser) = 2

     Let vFolderPath = '\\John Server\John directory\';


End If


Then I make sure that everywhere that uses a file path uses $(vFolderPath) instead.


All the user has to do is make sure that the vUser value is changed prior to reloading.