Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to get the QWV file path into a variable in order to use it for the laod-files.
Here was an idea:
to retrive only path :
tmpPath = ActiveDocument.GetPathName
lastBackSlash = InStrRev( tmpPath , "\" )
path = Left( tmpPath , (lastBackSlash - 1) )
The problem is, that there is an mistake in the script.
Can anyone help.
Thank you very much!
Robert
Jagan's suggestion should work, as in :
=Left(DocumentPath(), Index(DocumentPath(), '\', -1) - 1)
Best Regards, Bill
Hi,
The below script is working fine for me and returns the path of the current Qlikview file, what mistake you are getting. Where you are using it?
Sub Test
tmpPath = ActiveDocument.GetPathName
msgbox(tmpPath)
lastBackSlash = InStrRev( tmpPath , "\" )
path = Left( tmpPath , (lastBackSlash - 1) )
msgbox(path)
End Sub
Regards,
Jagan.
Thank you fpr your answer.
I didn't put it into a sub.
Is there a possiblity to get the information in the script without using a sub?
Thank you very much!
Robert
The function DocumentPath( ) should be what you need.
It returns a string containing the full path to the current QlikView document.
Best Regards, Bill
Hi,
Try this
=Left(DocumentPath(), Index(DocumentPath(), '\', -1) - 1)
Regards,
Jagan.
Hi Bill,
thank you for your answer.
But now I have the problem that, the result is:
d:\test1\qlikview\DocumentPath( )\
How can I delete this part (DocumentPath( ))
Thank u fpr your help
Robert
Jagan's suggestion should work, as in :
=Left(DocumentPath(), Index(DocumentPath(), '\', -1) - 1)
Best Regards, Bill
Hi Jagan,
thank you four your answer, but
SET Speicherort = Left(DocumentPath(), Index(DocumentPath(), '\', -1) - 1);
leads to
D:\TEST\QLIKVIEW\Left(DocumentPath(), Index(DocumentPath(), '\', -1) - 1)
Robert
Use LET instead of SET.
Best Regards, Bill
Hi Robert,
You need to be using Let instead of Set.
That should then work.