Qlik Sense

Integrating your Qlik Sense in Catalog

Requirements

To get things started with Qlik in Catalog, you will need:

  • Ability to use (or create) a user with access to needed spaces

  • Ability to create an API for that user. Follow the steps below: link

  • This user must have at least the "Developer" role

Related pages:

Setting up the API Key

Catalog managed

Please:

  • Input your credentials directly in the App with the following format:

{
    "apiKey": "*****",
    "baseUrl": "https://xxxx.xx.qlikcloud.com"
}

For your first sync, it will take up to 48h and we will let you know when it is complete ✅

If you are not comfortable giving us access to your credentials, please continue to Client managed 👇

Client managed

Doing a one shot extract

For your trial, you can simply give us a one shot view of your BI tool's

To get things working quickly, here's a Google Colab to run swiftly our package.

Running the Extraction package

Install the PyPi package

pip install castor-extractor[qlik]

For further details: link

Running the PyPi package

Once the package has been installed, you should be able to run the following command in your terminal:

castor-extract-qlik [arguments]

The script will run and display logs as following:

INFO - Extracting SPACES from REST API
INFO - Wrote output file: /tmp/catalog/qlik/1655814192-spaces.json
INFO - Extracting USERS from REST API
INFO - Wrote output file: /tmp/catalog/qlik/1655814192-users.json
INFO - Extracting APPS from REST API
INFO - Wrote output file: /tmp/catalog/qlik/1655814192-apps.json

...

INFO - Wrote output file: /tmp/catalog/qlik/1655814192-summary.json

Arguments

  • -b, --base-url: Qlik base url, your api endpoint, usually your qlik url homepage

  • -a, --api-key: the generated API_KEY from the Profile page settings

  • -o, --output: target folder to store the extracted files

Optional arguments

  • -e, --except-http-error-statuses: list of HTTP statuses for which to catch errors from and log " "as warning instead. Helpful to continue script execution when " "missing rights on some assets.

You can also get help with argument --help

Use ENV variables

If you don't want to specify arguments every time, you can set the following ENV in your .bashrc:

CASTOR_QLIK_BASE_URL
CASTOR_QLIK_API_KEY

CASTOR_OUTPUT_DIRECTORY

Then the script can be executed without any arguments:

castor-extract-qlik

It can also be executed with partial arguments (the script looks in your ENV as a fallback):

castor-extract-qlik --output /tmp/catalog

Scheduling and Push to Catalog

When moving out of trial, you'll want to refresh your Qlik content in Catalog. Here is how to do it:

The Catalog team will provide you with

  1. Catalog Identifier (an id for us to match your Qlik files with your Catalog instance)

  2. Catalog Token An API Token

You can then use the castor-upload command:

castor-upload [arguments]

Arguments

  • -k, --token: Token provided by Catalog

  • -s, --source_id: account id provided by Catalog

  • -t, --file_type: source type to upload. Currently supported are { DBT | VIZ | WAREHOUSE }

Target files

To specify the target files, provide one of the following:

  • -f, --file_path: to push a single file

or

  • -d, --directory_path: to push several files at once (*)

Then you'll have to schedule the script run and the push to Catalog, use your preferred scheduler to create this job

You're done!

Python usage

The extraction script mentioned in previous section works for basics usage. The following section allow custom usage of the library.

Using explicit arguments

from castor_extractor.visualization.qlik import extract_all

# run extraction
extract_all(
    base_url="https://<your-id>.<region>.qlikcloud.com",
    api_key="********",
    output_directory="/tmp/catalog",
    except_http_error_statuses=[403],
)

Using ENV

from castor_extractor.visualization.qlik import extract_all

# run extraction
extract_all()

If you want to manipulate a specific asset:

from castor_extractor.visualization.qlik import QlikClient, QlikAsset

client = QlikClient(
    server_url="https://<your-id>.<region>.qlikcloud.com", 
    api_key="********",
    except_http_error_statuses=[403],
)

# fetch spaces
spaces = client.fetch(QlikAsset.SPACES)

# fetch users
users = client.fetch(QlikAsset.USERS)

# fetch apps
apps = client.fetch(QlikAsset.APPS)

# fetch lineage - scoped on apps
lineage = client.fetch(QlikAsset.LINEAGE, apps=apps)

# fetch measures - scoped on apps
measures = client.fetch(QlikAsset.MEASURES, apps=apps)

Last updated

Was this helpful?