Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Distribution of measures to multiple Qlik Sense apps

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Ionut_Dumitrascu

Distribution of measures to multiple Qlik Sense apps

Last Update:

Feb 9, 2023 9:34:23 AM

Updated By:

Sonja_Bauernfeind

Created date:

Nov 15, 2021 9:17:41 AM

Attachments

This article gives an overview of the measure distribution use case. It explains a basic example of a template configured for this scenario and additions for a more advanced use case.

For this use case, we will define the following keywords/expressions:

  • master items: the following Qlik Sense objects are currently supported: measures, dimensions, and variables.
  • main app: A Qlik sense app stored in your tenant in which you define and maintain all your master items for distribution.
  • destination space: a space that contains all the Qlik Sense apps that you want your master items to be synced to.

By using this approach, all you need to do is create/update your master items in your main app, and then push these updates to all your destination apps. This way, all destination apps have the same master items.

To support this use case, we created a basic template, which uses measures as master items.

By running this template, you will be able to distribute all the measures created in your main app to all the apps available in the destination space.

 

Basic automation overview:

Create or Update Measure Automation.png

All you need to do is select your main app and your destination space.

Of course, this is just a basic implementation. This template can be upgraded to suit more advanced scenarios.

Let's go over a few examples:

  • you can sync multiple types of master items (ex: dimensions, variables) by adding their respective blocks into the template, in a similar fashion as the measure ones.
  • instead of syncing all the measures from your main app, you can filter them by applying a specific tag, and then using a Filter List block to select only the tagged measures.
  • you can also apply the filtering logic to create a selection of destination apps to sync your measures to, instead of an entire space.
  • you can add a deletion logic section that could come in handy when you delete measures from your main app and you want this to be mirrored in your destination space/apps as well.
  • you can include an input type block, with the inputs being the source app id, the destination space/apps ids and/or related tags or other optional inputs, so you can trigger the template from another source.
  • make sure the output of the List Apps block doesn't contain the source app. You can prevent this by:
    1. adding a space id to the List Apps block and making sure the source app is not in the same space as the target apps. 
    2. adding a Condition block right before the Create Or Update Measure block, this validates the app id from every app in the List Apps block's output to make sure it isn't executed for the source app.

 

Change distribution

The changes made by this automation won't be accessible immediately in other sessions (like the Qlik Sense UI) more info on that can be found here: Automation session delay. It can take up to 40 minutes for these changes to be visible in other sessions, if these changes are needed sooner in these sessions, the Save App block can be used. But keep in mind it can only be used once for every app that's changed by the automation. More information on the Save App block can be found here: How to use the Save App block.

For the above example, it's best to add an additional List Apps block that's configured exactly the same as the first one so, it returns the same apps. We'll add a Save App block in the loop of the new List Apps block and configure it to run for every app that's returned. This way, we make sure that the Save App block is executed only once for every app that was changed. See the image below for an example with the Save App block.

Create or Update Measure Automation with Save App.png

 

Advanced template overview:

First part: includes an input block for the source/destination apps and for the measure tags.

Create or Update Measure Automation Advanced.png

Second part: includes a measure deletion flow, for a complete sync automation process.

Create or Update Measure Automation Advanced with Deletion.png

Both these template examples are available as attachments.

 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

 

Tags (1)
Labels (2)
Comments
matsseverin
Partner - Contributor II
Partner - Contributor II

Hi,

I have tried the automation template for distribution of master measures and it fails to create measures which contains SET expressions with double quotes, for example:
Sum({<Year={"$(=max(Year))"}>}Sales)

I also had same issues where the measure expression was entered across multiple lines (including line breaks).

Can you please provide an example on how you can copy across master measures that may contain double quotes, line breaks etc. Do you need to convert the expression using some formula or other block?

Kind regards,
Mats

hanselalf
Contributor II
Contributor II

Hello,

why is "List Of Apps for Lookup" limited to 100? The output of a block should be the same as "Maximum number of items to retrieve"!


Can I use  List of Apps for the Input from a specified Space?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @hanselalf I'm looking into this for you; currently, this is how the API would function, but I will reach out to our product management team to find out how pagination is meant to be handled if you have over a hundred apps.

All the best,
Sonja 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @hanselalf This was confirmed as a limitation. I would recommend logging an idea/suggestion so our product management team can review the suggestion accordingly.

All the best,
Sonja 

hanselalf
Contributor II
Contributor II

Hallo @Sonja_Bauernfeind 
On Enterprise level, you will (allways) have mor than 100 apps (we have). The apps are read of the hole Server, space info is also nessesary!
This behavior is a bug, so I will create a support case.

Greg_Oliven
Partner - Contributor III
Partner - Contributor III

Hi @Ionut_Dumitrascu @Emile_Koslowski @Sonja_Bauernfeind,

In the output of my Create or Update Measure block, I get the error the the GetLayout method is not found:

jsonrpc:
2.0
id:
1
 
error
code:
-32601
parameter:
GetLayout
message:
Method not found
 
The output of the other blcks looks right - I am picking up my measure with the for_sync tag from my source app, and am correctly enumerating my apps in my target space. Any ideas about this one error?
Version history
Last update:
‎2023-02-09 09:34 AM
Updated by: