Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

How to : Qlik Application Automation for Loop and Reduce - Dynamic process

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Vincenzo_Esposito

How to : Qlik Application Automation for Loop and Reduce - Dynamic process

Last Update:

Feb 14, 2023 4:44:16 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 21, 2021 5:26:28 AM

Attachments

Some of the QlikView users should remember the Loop and Reduce functionality. It has been made available in Qlik Sense only through the use of API calls, which scared quite a few people uncomfortable with anything but the GUI. That was until the arrival of Qlik Application Automation which turns it in a piece of cake for everyone.

You can find other two articles on the Loop and Reduce block, they both are linked on the bottom of this page. Unlike the mentioned article, this solution will use only one dynaminc automation to process any application made or to come

This guide does not cover
  • Basic use of Qlik Sense Enterprise SaaS
  • How to connect Qlik Application Automation Connectors 
  • How to write security rules to grant access to specific groups on each app slice
What we are going to achieve:

We want any App with a master item DIMENSION having a specific TAG, will be splitted on that dimension. This will happen on every reload event.  Moreover we also want to have the chance to drive the publish action on a specific space id.

 

1. Create the Automation

From your tenant web hub:

  1. Click Add new 
  2. Click New Automation 
  3. Give your new automation a name description. Optionally, select the more appropriate icons
  4. Click Save

 

a. Start Block

We want to trigger this automation every time an app is reloaded. In the Start Block select:

  • Run Mode:  Webhook
  • Connector: Qlik Cloud Service
  • Event:  App Reload Finished

 

b. Get the target space ID

The Loop and Reduce process produce several applications, and we don't want to pollute the personal space, for this reason, we want to move all of them to a separated space.

From the Qlik Cloud Service Connector drag the List Variables into the canvas and attach it to the start block. Fill the App Id with the app id coming from the start block:

App Reload Finished > Data  > Id

Schermata da 2021-09-17 13-58-22.png

This block will return all the variables in the app, we are going to use it later to catch the target space id.

 

c. Let's check if we have to reduce this App

We expect to see a special TAG named LR on a Dimension, in order to proceed in the loop and reduce process. 

Now let's start the loop over all the Dimensions. From the left-hand side menu select Qlik Cloud Service and then drag the List Dimensions block just out of the List Variables loop. Fill the App Id fields with the reloaded app id coming from the start block:

App Reload Finished > Data  > Id

 

Schermata da 2021-09-17 14-01-59.png

 

List Dimension will loop over all dimensions in the reloaded app. For each dimension we want to check if there is the tag named LR. From the basic block,  drag the condition block in the List Dimensions loop. We want to check if the Tags Array contain the TAG named LR.

In the first box set List Dimensions > Itam > Q Meta > Tags , then select Contain and in the last box type LR.

Schermata da 2021-09-17 14-04-31.png

 

In case we found it we are ready to trigger the Loop And Reduce block, you can find it under the Qlik Cloud Service Connector. Fill the App Id field with the application id coming from the start block.

App Reload Finished > Data > Id

And fill the Reduction Field with the Dimension Title name

List Dimensions  > Item > Q Meta > Title

Schermata da 2021-09-17 15-19-01.png

 

The Loop And Reduce block create slices of the original application and export them with  an Id. At this point we can re-import it in a different location and with a different name, for this work we need the Import App From Export Id block, you can find it in the Qlik Cloud Service Connector.

Fill in the fields as follow:

  • File Id: Export Id coming from the previous block
  • Name: The original app name followed by the reduced dimension value

 

Schermata da 2021-09-17 15-20-09.png

 

For the Space Id, click on the listVariables block, select the qDefinition then the below windows will appear. Select the last option and pick the value when the qName is equal to TargetSpace

Schermata da 2021-09-17 15-32-49.png

In case the TargetSpace variable does not exist in the app, the reduced app will be generated in the personal space.

 

2. Set the Qlik Sense Enterprise SaaS environment

Open the App you want to reduce and create a new dimension. In this example the dimension is a simple field mapping, but you can use Qlik functions to build a complex field combination. You just need to add the TAG LR on the dimension you want to use for the Loop and Reduce.

Vincenzo_Esposito_0-1631786663625.png

If you want all the reduced apps to be collected in a space different from your Personal space, it is enough to add a new variable with the name "TargetSpace" and set it to the space Id.

Schermata da 2021-09-17 11-46-59.png

 

 

Import Task

As usual, you can follow the above steps to get your automation done or you can just import it from the Automation JSON definition attached in this article.

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.

 

Environment

Related Content

Labels (1)
Version history
Last update:
‎2023-02-14 04:44 AM
Updated by: