Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Is it possible to get the folder name of the current job?

Hello, 
Is it possible and how can I get the folder name of the current job?
I'm talking about the folders in which jobs are organized in TOS JobDesigns (not disk directories).
For example if I'm executing job "CreateXMLFeed" I want to assign to a variable the folder name - "Google"
(sorry for the ASCII drawing - for some reason the forum currently does not allow uploading images/screenshots):
Job Designs
+- Google
  +- CreateXMLFeed
  +- UploadFeed
+- Tests
  +- TestJob1
  +- TestJob2    

Thanks, 
Mirko
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi mirkodev 
There is still an real folder name called 'Google' in workspace/yourProjectName/process directory in the file system, so you can iterate all the job file names in this directory, compare the file name with current job name and get the current folder name. 

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hi Mirko
No a global variable can be used to get it directly, I think you can create a subjob to get it, below is my idea: use a tFileList to iterate each file name in the workspace folder, includes its sub-folder, if the file name equals to the jobName (this is a global variable for the current job name), exit the loop and get the current folder path.
Anonymous
Not applicable
Author

What I usually do in situations like this is to have a 'google' context group that is added to all of the Jobs in the Google folder. I can then add this, and any other parameters that I want to apply to all of these Jobs.
Anonymous
Not applicable
Author

Hi Mirko
No a global variable can be used to get it directly, I think you can create a subjob to get it, below is my idea: use a tFileList to iterate each file name in the workspace folder, includes its sub-folder, if the file name equals to the jobName (this is a global variable for the current job name), exit the loop and get the current folder path.

Hi Shong, 
I'm not sure I understand you and I think you are talking about the file system directory, while I need, as mentioned, the "folder" in which jobs are organized under Job Designs.
tal00000:
What I usually do in situations like this is to have a 'google' context group that is added to all of the Jobs in the Google folder. I can then add this, and any other parameters that I want to apply to all of these Jobs.
Hi Thanks, nice workaround.
So If I understand correctly there is NO way to get the actual job folder name, right?
Anonymous
Not applicable
Author

Hi mirkodev 
There is still an real folder name called 'Google' in workspace/yourProjectName/process directory in the file system, so you can iterate all the job file names in this directory, compare the file name with current job name and get the current folder name. 
Anonymous
Not applicable
Author

Hi mirkodev 
There is still an real folder name called 'Google' in workspace/yourProjectName/process directory in the file system, so you can iterate all the job file names in this directory, compare the file name with current job name and get the current folder name. 

Aaagh... I see now! Thanks for the trick Shong!
But this means this won't be available when I build the job as standalone job... 
Anonymous
Not applicable
Author

Yes, it will not be available if the job script is executed on another machine,  I am interesting in why you need to get the current folder name in the job. 
Anonymous
Not applicable
Author

Thanks shong! It's just for better organization and my logging module (I'm grouping my components in folders)