Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
jpjust
Specialist
Specialist

File watcher File - Qliksense reload task complete

Hi All,

Is it possible to export an txt file or some thing at the end of the load script?

Then I can use that file as an file watcher for other programs to run. Other way of telling that the qliksense reload task is complete.

Any other ideas are welcome as well.

Thanks

1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In your use case scenario you will have to use the EXECUTE [1] command.

 

Here are the steps that you should follow:

  1. Create a folder that you want to monitor for a file creation. e.g. "My Location" folder on "Desktop"
  2. Open Notepad and copy paste: >> "echo Qlik Sense reload was completed! > "C:\...\Desktop\My Location\log.txt" <<
  3. Note: The quotes are included in the statement, because if your path has spaces it will fail. But using quotes will work every time, either the path has spaces or not. 
  4. Click on Save As
  5. Choose Name "executable.bat"
  6. Choose Save as type "All files (*)"
  7. Note: You have to make sure that your saved file is NOT named executable.bat.txt but is named executable.bat. Otherwise, it will not get executed by CMD.
  8. In Qlik Sense you have to setup some configurations first, so follow the steps in the official documentation [1] carefully.
  9. Now open Data load editor and add the following statement at the end of the script:
  10. Execute "C:\Windows\System32\cmd.exe" /R "C:\Users\...\Desktop\My Location\executable.bat"
  11. This will use the CMD in the defined path (first part of the command) and will execute the "executable.bat" that you have created. 
  12. When the bat file is executed, you will see that the "log.txt" will be created.
  13. You can modify the text that you are saving in the bat file to make it unique each time e.g. saving the current date and time that the log.txt was created. This way when you read the file with another software you will know if the file was created recently etc.

Here is my result after Data load editor finished execution:

 

I hope that this information was helpful.  

---

[1] https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegula...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

2 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In your use case scenario you will have to use the EXECUTE [1] command.

 

Here are the steps that you should follow:

  1. Create a folder that you want to monitor for a file creation. e.g. "My Location" folder on "Desktop"
  2. Open Notepad and copy paste: >> "echo Qlik Sense reload was completed! > "C:\...\Desktop\My Location\log.txt" <<
  3. Note: The quotes are included in the statement, because if your path has spaces it will fail. But using quotes will work every time, either the path has spaces or not. 
  4. Click on Save As
  5. Choose Name "executable.bat"
  6. Choose Save as type "All files (*)"
  7. Note: You have to make sure that your saved file is NOT named executable.bat.txt but is named executable.bat. Otherwise, it will not get executed by CMD.
  8. In Qlik Sense you have to setup some configurations first, so follow the steps in the official documentation [1] carefully.
  9. Now open Data load editor and add the following statement at the end of the script:
  10. Execute "C:\Windows\System32\cmd.exe" /R "C:\Users\...\Desktop\My Location\executable.bat"
  11. This will use the CMD in the defined path (first part of the command) and will execute the "executable.bat" that you have created. 
  12. When the bat file is executed, you will see that the "log.txt" will be created.
  13. You can modify the text that you are saving in the bat file to make it unique each time e.g. saving the current date and time that the log.txt was created. This way when you read the file with another software you will know if the file was created recently etc.

Here is my result after Data load editor finished execution:

 

I hope that this information was helpful.  

---

[1] https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegula...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
jpjust
Specialist
Specialist
Author

Thank you Andrei so much. I think this should help with my usecase.

I will give it a try and let you know.