Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I tried with this, but I didn't sorted out.
I got the solution mean time..
I used this
myUser:
load
'C:\Users'&Mid(OSUser(),Index(OSUser(),'\'))&'.'&left(OSUser(),Index(OSUser(),'\')) as User
AutoGenerate 1;
let vUser = peek('User',0);
drop table myUser;
DIRECTORY [$(vUser)Dropbox\Contatti\Piani];
it works, but now the myUser table is not really dropped and the load statement after defined loads data into this table
my_table:
load
Getfolderpath('DashBoard') as dropBox
AutoGenerate 1;
let vDropBox = peek('dropBox',0);
drop table my_table;
DIRECTORY [$(vDropBox )\Contatti\Piani];
....
HI Ali,
it return me
\\server\user\v.dambruoso\Documents
instead of
C:\Users\v.dambruoso.MANGINI\Dashboard
why?
what can I do?
may you please show me what you wrote in your script?
hi,
myTable:
load
Getfolderpath('Dropbox') as dropBox
AutoGenerate 1;
let vDropBox = peek('dropBox',0);
drop table myTable;
DIRECTORY [$(vDropBox)\Contatti\Piani];
I think the problem is on the Dropbox folder, with is on my local user profile.
QlikView search in \\server\user\v.dambruoso\Documents .... !!
Is there a function to get the system users to buid the path, or is there a way to choose from a list of path and reload the data after?
Thank you
you got the same folder structure on your local machine and on the server
if yes then you can use relative paths
relative to the QVW file in which you have the script
suppose your folder structure is as follows:
Application (main folder)
DropBox (sub-folder) ->Contatti->Piani (2 sub folders)
QVW (subFolder)
suppose your file (qvw) is inside a sub-folder under QVW folder called myApp
then you can access the xml file as ..\..\DropBox\Contatti\Pianni\your_xml_file
hope this helps
I tried with this, but I didn't sorted out.
I got the solution mean time..
I used this
myUser:
load
'C:\Users'&Mid(OSUser(),Index(OSUser(),'\'))&'.'&left(OSUser(),Index(OSUser(),'\')) as User
AutoGenerate 1;
let vUser = peek('User',0);
drop table myUser;
DIRECTORY [$(vUser)Dropbox\Contatti\Piani];
it works, but now the myUser table is not really dropped and the load statement after defined loads data into this table
can you show me in some way the folder structure of your application
may I can figure out
To get the user you could try it with: osuser() or getregistrystring().
- Marcus
"Cruscotto_Piani_Commerciale" is the dashboard I'm working on.
"Piani" is the folder I use to store xlsx files.
and both are on Dropbox folder