Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created an app in e.g. TestFolder, and then copied it to e.g. LiveFolder. Now, I want to know which folder my app is running in to create different security in Section Access. If I trace the QvWorkPath variable at that point it still shows TestFolder. (I read in the help file that system variables are set at creation time?) Is this usual, and how should I be finding the current directory?
Cheers,
Colin
Hi,
Just reload the qlikview file, now you will get the latest path by using the QvWorkPath.
If reload is not possible try File -> Partial Reload option.
Hope this helps you.
Regards,
Jagan.
Hi,
Just reload the qlikview file, now you will get the latest path by using the QvWorkPath.
If reload is not possible try File -> Partial Reload option.
Hope this helps you.
Regards,
Jagan.
Or use the QV system function
DocumentPath( )
to get the current doucment path, should work even without reloading.
Hope this helps,
Stefan
Yes, found a forum post about changing Qlikview to update the variables at the start of the script rather than the end.
Thanks, guys.
DocumentPath() returns the file path but not the current directory. I could not find an easier way to get the current path (without reloading) so I did the following:
/*Stores Current Working Directory into VarName*/
SUB CurrentWorkingDirectory(VarName)
Let N = SubStringCount(DocumentPath(),'\');
Let $(VarName) = SubField(DocumentPath(),'\',1);
for i = 2 to N
Let $(VarName) = '$($(VarName))\'& SubField(DocumentPath(),'\',$(i));
next
ENDSUB
=Left(DocumentPath(), Index(DocumentPath(),'\',-1))
?
doh! yes that is much better