How to Pass Qlik Sense Load Script Variables Into An External Script Via EXECUTE StatementArticle Number: 000051383 | Last Modified: 2018/11/22
- Qlik Sense Enterprise, All Versions
Warning: Disabling standard mode can create a security risk by exposing the file system.
2. Ensure the external script can accept command line arguments. For example, if using Python then import the argparse utility and use that to pass in arguments from the command line.
# example.py import argparse parser = argparse.ArgumentParser() parser.add_argument('--foo', help='foo help example') args = parser.parse_args() print(args.foo) # just print back what was passed from the command line input("Press any key to continue...") # keep the command line window open for demonstration purposes, note the script won't finish executing until the window is dismissed
3. Pass in your variables from the load script into the command line, similar to below (assumes python is in the PATH variable):
Set arg = "bar"; EXECUTE python C:\path\to\your\script\example.py --foo $(arg);
If you need further help/assistance, please reach out to Consulting Services. Ask for your Account Owner's contact information, or see How to Contact the Consulting Team?.
Note: Qlik does NOT support the 3rd party software mentioned and used in this documentation. Please use them at your own discretion and, if concerned, contact the proper IT team within your company to verify the ability to use non-Qlik related software in the environment.
Note: Debugging or writing custom code is supported by the Qlik Professional Services or Presales teams. This example is provided for demonstration purposes to explain specific scenarios. No Support or maintenance is implied or provided. Further customization is expected to be necessary and it is the responsibility of the end administrator to test and implement an appropriate rule for their specific use case.
Have a Question?
Search Qlik's Support Knowledge database or request assisted support for highly complex issues.Submit a case
Experiencing a serious issue, please contact us by phone. View phone numbers and hours by region.