Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

How to: Loop and reduce with Qlik Application Automation (basic)

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

How to: Loop and reduce with Qlik Application Automation (basic)

Last Update:

Dec 6, 2022 6:00:05 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 10, 2021 5:16:03 AM

Attachments

Note: loop and reduce will remove an app's section access that was defined through the load script. Offline usage needs to be enabled in your tenant's management console in order to use the Loop And Reduce block on an app outside a personal space. More information on offline usage.

See this article if your app contains always one selected value fields.

This article explains how a basic loop and reduce operation can be performed on a Qlik Sense app by using Qlik Application Automation. 

A more advanced example can be found here

The source app used in this article can be downloaded here

Attached to this article is a file of the exported automation used in this article. More information on importing automations can be found here.

Loop and reduce + (re)publish to managed space

Create a new automation and follow these steps to perform a loop and reduce action on a QCS app:

  1. Go to the Qlik Cloud Services connector and search for the block "Loop And Reduce". Drag this block inside the automation editor.
  2. Specify the id for the app that should be used as a source app. The reduction will be performed on this app. Next, specify the field name over which the loop should run, for each unique value of the specified field name, a reduced app will be created. In this example, CountryName will be used as the reduction value.

    Emile_Koslowski_1-1631100768236.png

     

  3. The reduced apps are stored on the Temporary File services. The Loop And Reduce block will return a list of file ids together with the unique value of the reduction field and a list of sheet ids for the sheets that were public on the source app.
  4. The next step is to import the reduced apps and publish them to a managed space. In this basic example, this is done by one block: "Publish Reduced App To Managed Space". If you want to know what's happening inside this block, visit this article for an advanced example on loop and reduce.
  5. Search for the block "Publish Reduced App To Managed Space" and drag it inside the loop created by the Loop And Reduce block.
  6. Apply the following mapping in the publish block:
    1. Exported App Id -> the "exportId" from each item in the list.

      Emile_Koslowski_2-1631265185162.png

    2. Name -> specify a name for the reduced app. Use the "reduced_value" from each item in the list to create distinct app names. 

      Emile_Koslowski_0-1631265074876.png

    3. Public Sheets ->  the "publicSheets" from each item in the list. 

      Emile_Koslowski_1-1631265171341.png

    4. Space Id -> id for the managed space to which the reduced app should be (re)published.

      Emile_Koslowski_3-1631265226035.png

  7. Click run to execute the integration.

Below is an image of the full example. A JSON export of this example is attached to this article as loop_and_reduce_basic.json.

 

Emile_Koslowski_0-1633101025095.png

 


 

Labels (2)
Comments
arychener
Partner - Contributor III
Partner - Contributor III

Thanks a lot for this article!

I have two "problems" when using this block:
- the application on which we want to do the "Loop and reduce" must be in my personal space, otherwise it doesn't work
- a favorite is created in the application for each loop
Is this normal?

Thanks!

Amélie

Version history
Last update:
‎2022-12-06 06:00 AM
Updated by: