Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rbarboza
Partner - Contributor II
Partner - Contributor II

Loop and reduce

Good afternoon, is there a way to reduce an application from a condition. 
For example, reduce the sales application by the country field where country is equal to Argentina and Chile.
Use the Loop and reduce block. But I don't know how to add a condition to filter by two countries.
Thank you.-
 

 

Labels (1)
2 Replies
Shai_E
Support
Support

Hi @rbarboza 

What if you do the following:

1.  Loop And Reduce the app using the "Loop And Reduce" block
2. Inside the loop use a "Condition" block
3. Have the Condition block setup as follows:

If reduced values equals to Argentina and If reduced values equals Chile

4. if the expression in point 3 is true, use the "Publish Reduced App To Managed Space"

Please note i think this wont stop the loop from looping through all field values.

A better way might be to store these two countries in an array and each time the condition is true, pop off one of the countries from the array, when the array is clear use a stop block to maybe stope the automation

rbarboza
Partner - Contributor II
Partner - Contributor II
Author

Thank you so much. From what I understand, the result would be two applications, one with each country filtered. And what I'm looking for is a single application with the two countries filtered.