Skip to main content

Qlik Sense Documents

Qlik Sense documentation and resources.

Advanced Scheduling in Qlik Sense Enterprise SaaS

cancel
Showing results for 
Search instead for 
Did you mean: 
Levi_Turner
Employee
Employee

Advanced Scheduling in Qlik Sense Enterprise SaaS

Objective:

For this document, we will review how to leverage Qlik Sense Enterprise SaaS' open APIs to build advanced reload schedules.

Requirements:

Background:

Qlik Sense Enterprise SaaS implements reload schedules based on the RFC 5545 specification which is commonly known as rrule. The GUI presents a common subset of possible schedules with GUI-based options including hourly, daily, weekly, monthly, and yearly.

Qlik Sense Enterprise SaaS additionally exposes scheduling based on IANA Time Zone Database names. While this guide is written with a timeZone parameter set as America/New_York, refer to further documentation on additional permitted options.

This guide will use qlik-cli to abstract the RESTful API requests to build the reload task. There are additional parameters exposed in the qlik reload-task create command (e.g. partial reloads). Refer to qlik-cli's documentation for further guidance. For integrations where interaction occurs outside of qlik-cli, an example body of a reload task creation is as follows:

 

{
  "appId": "58f563b6-ccda-45b0-926c-e2992ca8b470",
  "recurrence": [
    "RRULE:FREQ=MINUTELY;INTERVAL=15"
  ],
  "startDateTime": "2022-03-23T00:00:00",
  "timeZone": "America/New_York",
  "type": "scheduled_reload"
}

 

This guide was written for use with the Windows PowerShell program. While PowerShell can be run on non Windows systems, use of bash techniques for parsing json (e.g. jq) is possible but not covered in this guide.

Examples of advanced schedules:

Reload a specific app every 15 minutes

 

# Specify the appId
$appId = '<myAppId>'
# Define the rrule
$schema = 'RRULE:FREQ=MINUTELY;INTERVAL=15'
$startDate = ((Get-Date)).ToString("yyyy-MM-ddT00:00:00") # Get the current date and convert to required format
# Get the app's reload tasks
$reloadTask = qlik reload-task ls --appId $($appId) | ConvertFrom-Json
# Delete the associated reload task, if present
if($reloadTask.data.Length -gt 0) {
    $null = qlik reload-task rm $($reloadTask.data.id)
}
# Create the task
$null = qlik reload-task create --appId $appId --recurrence $schema --startDateTime $startDate --timeZone "America/New_York" --type "scheduled_reload"

 

 

Reload a specific app every hour on Thursday

 

# Specify the appId
$appId = '<myAppId>'
# Define the rrule
$schema = 'RRULE:FREQ=HOURLY;INTERVAL=1;BYDAY=TH'
$startDate = ((Get-Date)).ToString("yyyy-MM-ddT00:00:00") # Get the current date and convert to required format
# Get the app's reload tasks
$reloadTask = qlik reload-task ls --appId $($appId) | ConvertFrom-Json
# Delete the associated reload task, if present
if($reloadTask.data.Length -gt 0) {
    $null = qlik reload-task rm $($reloadTask.data.id)
}
# Create the task
$null = qlik reload-task create --appId $appId --recurrence $schema --startDateTime $startDate --timeZone "America/New_York" --type "scheduled_reload"

 

 

Reload a specific app on the 2nd Monday of the month

 

# Specify the appId
$appId = '<myAppId>'
# Define the rrule
$schema = 'RRULE:FREQ=MONTHLY;WKST=MO;BYDAY=MO;BYSETPOS=2'
$startDate = ((Get-Date)).ToString("yyyy-MM-ddT00:00:00") # Get the current date and convert to required format
# Get the app's reload tasks
$reloadTask = qlik reload-task ls --appId $($appId) | ConvertFrom-Json
# Delete the associated reload task, if present
if($reloadTask.data.Length -gt 0) {
    $null = qlik reload-task rm $($reloadTask.data.id)
}
# Create the task
$null = qlik reload-task create --appId $appId --recurrence $schema --startDateTime $startDate --timeZone "America/New_York" --type "scheduled_reload"

 

 

  • Note: The hour  which the reload is executed with daily / monthly / yearly is determined by the startDateTime value. In this example, the value is set to midnight, adjustment to align with desired business or batch hour is encouraged.

 

Labels (2)
Version history
Last update:
‎2022-04-06 09:01 AM
Updated by:
Contributors