Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
patbuchanan
Contributor III
Contributor III

Can I use the variable %USERPROFILE% in my load script?

I'm trying to edit a script to use %USERPROFILE% instead of using c:\users\computer name\ to help someone who moves around to different machines that has Qlikview licenses and has the their excel file loaded in the same dropbox location on each computer.  So, instead having to change the load statement and create different files, I was trying to use the path to the %USERPROFILE%...

//[%USERPROFILE%\Dropbox\Apps\Attachments\Data.xls

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can't access the variable directly, but you can use the GetFolder() function to retrieve the same value.

LET vUserprofile = GetFolderPath('Profile');

LOAD ...

FROM [$(vUserprofile)\Dropbox\Apps\Attachments\Data.xls

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

2 Replies
gmoraleswit
Partner - Creator II
Partner - Creator II

You can do something like this:

EXECUTE cmd.exe /c echo %USERPROFILE% > user.txt;

path:

LOAD @1 as userpath

FROM

user.txt

(txt, codepage is 1252, no labels, delimiter is '\t', msq);

let v = Peek('userpath',0,'path');

DROP Table path;

Check attachment.

Hope this helps.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can't access the variable directly, but you can use the GetFolder() function to retrieve the same value.

LET vUserprofile = GetFolderPath('Profile');

LOAD ...

FROM [$(vUserprofile)\Dropbox\Apps\Attachments\Data.xls

-Rob

http://masterssummit.com

http://robwunderlich.com