Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
May 8, 2023 3:15:21 AM
Sep 8, 2021 9:48:19 AM
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 How to Loop and Reduce with always one selected value fields if your app contains always one selected value fields.
This article explains how a loop and reduce operation can be performed on a Qlik Sense app by using Qlik Application Automation. It covers two examples, in the first one, the reloaded apps will be (re)published to one space. In the second example, each reduced app will be (re)published to a separate space.
This article covers two advanced examples, a more basic example can be found here .
The source app used in this article can be downloaded here.
Attached to this article are 2 files of the exported automations used in this article. More information on importing automations can be found here.
In this example, all reduced apps will be (re)published to the same space.
Create a new automation and follow these steps to perform a loop and reduce action on a Qlik Cloud app:
An example of a completed automation:
Attached example file: loop_and_reduce_to_same_space.json
In this example, each reduced app will be published to a different space. We'll use the Insurance Claims app and the automation for the first example again. Since this app reduces on the field CountryName, we'll start by creating a managed space for each unique value that's found for CountryName. This results in the following list of spaces:
Next is to create a mapping for each unique reduction value and the corresponding space's id. There are multiple ways to achieve this. In this example, this mapping is stored in a JSON list of objects with the keys reduction_value and space_id. Feel free to use an automation to create the managed spaces and build this list.
Example:
[
{
"reduction_value": "Scotland",
"space_id": "6138a3062c1054d8158c189a"
},
{
"reduction_value": "Northern Ireland",
"space_id": "6138a318faed485d36ae911f"
},
{
"reduction_value": "England",
"space_id": "6138a337faed485d36ae9126"
},
{
"reduction_value": "Wales",
"space_id": "6138a33f98b0d0bf7e719dfb"
},
{
"reduction_value": "Guernsey",
"space_id": "6138a349faed485d36ae912b"
},
{
"reduction_value": "Isle of Man",
"space_id": "6138a35aba392246d331e611"
},
{
"reduction_value": "Jersey",
"space_id": "6138a3653ec592fe53a8d55b"
}
]
The next step is to store the mapping in the automation. Execute the following steps to do this:
Attached example file: loop_and_reduce_to_mulitple_spaces.json
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.
Does any type of solution exist for on-prem? ODAG? Something else? Thank you!
No, Qlik Application Automation is only available for Qlik Sense Enterprise for SaaS.
Bummer, but thank you for the clarification.
Great content @Emile_Koslowski !
Are there any plans to make this actually "enterprise-ready"? By that I mean that now it takes a great deal of manual work and complexity to actually make a loop&reduce that is trustworthy and does what it needs to do.
Disabling the section access in the reduce is the worst thing here, as it's not usually enough to limit visibility based on the slice alone.
Deactivating and Reactivating AOSV-fields manually adds work and likelyhood of mistakes, there can be 1-N of those fields in one app. And one needs to re-apply the default selected value as well.
Due to the above, you need to import to somewhere else before completing the steps and only then publish. That means also publishing sheets, adding descriptions..It's a complex automation for a fairly simple use case.
So basically, when can we get a similar plug-and-play that we had in Qlikview?
Why can't you just have an automation to create the spaces? It can easily create the spaces based on the same reduction value and create the Id automatically.
In fact, why create the spaces ahead of time at all? The spaces could be easily created using the reduction value or some other formula and updated based on that as well. Resulting in one loop that will both create and update the spaces as needed.
What happens if I only want to create less spaces that I have loop values I guess I have to build each one separately.
Hello @Spartan27215
I recommend posting your query directly in our Qlik Application Automation forum to make use of the wider reach into our community and our active support engineers.
All the best,
Sonja
To clarify an earlier response to a question: Loop and Reduce is available for Qlik Sense on-premise via the Application Management Console (AMC). Application Automation is not available for on-premise.
How can I reload apps created in each space taking into account that the field name over which the loop runs is also the one I used for section access? If I reload each one, even in an automation flow, it will get all data
Hello @DanielCordon
I recommend posting your requirement in the Qlik Application Automation forum, where our active product experts and your knowledgeable Qlik peers are better able to assist you.
All the best,
Sonja