Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

can I execute python file in the script(when loading the data)?

I want to run the python file when loading the data.

Can I do that??

I would appreciate it if you could help me..

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

The Execute statement can be used in a Qlik load script - but you have to disable standard mode:

Disabling standard mode ‒ Qlik Sense

Then you can use the Execute statement to start Python from the load script.

http://help.qlik.com/en-US/sense/3.2/Subsystems/Hub/Content/Scripting/ScriptRegularStatements/Execut...

The Python program running this way will not have any special access to Qlik Sense while running unless you use standard mechanisms that are available otherwise like for example the filesystem.

View solution in original post

9 Replies
petter
Partner - Champion III
Partner - Champion III

You can't embed Python script into the data load or mix and match the Qlik Load Script language with Python language.

There is however a beta of something called Qlik Server Side Extensions which can call Python functions from both Qlik Load Script as an additon to the native functions you have in Qlik. This feature can also be used in the UI in charts and any expressions in the UI.

The ability to use the SSE is enabled in Qlik Sense 3.1 and above. You will need the Qlik SSE SDK which is a zip-file with the necessary files and documentation with sample apps and scripts for both Python and R.

petter
Partner - Champion III
Partner - Champion III

The Execute statement can be used in a Qlik load script - but you have to disable standard mode:

Disabling standard mode ‒ Qlik Sense

Then you can use the Execute statement to start Python from the load script.

http://help.qlik.com/en-US/sense/3.2/Subsystems/Hub/Content/Scripting/ScriptRegularStatements/Execut...

The Python program running this way will not have any special access to Qlik Sense while running unless you use standard mechanisms that are available otherwise like for example the filesystem.

Not applicable
Author

I really appreciate your effort

It's much more complicated than I expected,,,but I'll try it

Thank you so much!!

Not applicable
Author

Hi Swana,

Are you looking for anything like this: Qlikview With Python

https://www.linkedin.com/pulse/qlikview-python-bikash-debnath

Else, you should check for Qlik Analytics Platform

Not applicable
Author

I tried

set vPath = 'C:\Python36\python.exe';

set vFile = 'C:\Users\woo\Documents\pythonworkspace\usingselenium.py';

execute  $(vPath) $(vFile);

in Legacy Moad(disable standard mode).

Now, the Load Date process is successfully finished, but nothing happened... my python file is not executed....

petter
Partner - Champion III
Partner - Champion III

Are you running this on Qlik Sense Desktop or Qlik Sense Server?

Qlik Sense Desktop might not show any kind of window for the executing program. So what is your Python program doing?

Not applicable
Author

I used Qlik Sense Desktop and that's why I can't show any changes. My python code is for downloading the file from web with web browser interaction.(I use selenium package), so after the code executed the downloaded file should remain on the download folder.

Anonymous
Not applicable
Author

Hi Swana,

You will be able to call python code much more effectively / natively using Server Side Extensions (SSE), which is now released in the Product Insight area of Community: https://community.qlik.com/docs/DOC-18433

I encourage you to try that and leverage SSE/Python in your load scripts!

Best,

Chris

robynbitner
Contributor II
Contributor II

Any updates on this? I'm having the same problem.