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: 
SimonInc
Partner - Contributor II
Partner - Contributor II

DocumentName() contains session id

I have a customer where I use DocumentName() to prefix generated csv-files created within the script. In most cases everything works properly but sometimes the function creates the sessionID instead of the app id. Why does this happen? How can I prevent this behaviour? Is there a workaround without using Qlik API or extensions?

Thanks

Best
Simon

Labels (1)
6 Replies
marcus_sommer

Maybe you could bypass this issue with extracting the relevant information from documentpath().

- Marcus

SimonInc
Partner - Contributor II
Partner - Contributor II
Author

I am afraid this will not work in Qlik Sense but only in QlikView. If I remember correctly in Sense this function does not contain anything in the server version (maybe in the desktop version).

marcus_sommer

I don't know Sense well enough if this information is stored and accessible in similar way like in documentname() elsewhere but by applying some additionally efforts you may bypass it, for example by storing the information parallel in a variable, too or directly reading the qvf (I assume the general logic of combining xml-headers and binary data like in Qlik View is further used).

Beside this you may look if this app is opened elsewhere if documentname() returned a session-id instead of the name. I assume you will be able to differ between an id and the name and using it within a check-routine which might be repeated n times within a loop and which results are separately stored as qvd. With it you may comprehend if it's just temporary and after n times the documentname() worked again or using these information including the id and timestamps and similar information for further investigation within the various log-files.

- Marcus

SimonInc
Partner - Contributor II
Partner - Contributor II
Author

In Qlik Sense there are three functions available:

1. DocumentTitle() => Contains the app name which is not useful because an app name can exist multiple times

2. DocumentPath() => Cannot be used because there is no need to get the path of a qvf-file in Qlik Sense anymore because all files are stored at the same place

3. DocumentName() => The function name is a bit misleading, but it should contain the app ID. This is the only option to get the correct link to an app except using an extension for it.

marcus_sommer

To 2. I have some doubts - really all at one place? How are then multi-tier architectures implemented - pure technically it may work but to keep logically the overview ...

- Marcus

SimonInc
Partner - Contributor II
Partner - Contributor II
Author

All logic is done in the QMC. So meta information are stored within the PostgreSQL database. So it is a complete different look and feel. The files themselves no longer have as much importance as in QlikView.

Coming back to my question... Does anyone have the same problem as me and possibly a solution?