Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, 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: 
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
MVP & Luminary
MVP & Luminary

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
Partner
Partner

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.

MVP & Luminary
MVP & Luminary

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