Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Ipsita2023
Contributor
Contributor

Pass the filter value in a loop in Qlik Sense automation

Hi All,

My requirement is :

I have a field Division and it contains 5 different values

Division Region
A xxx
B xxx
C yyy
D yyy
E xxx

 

I want to pass only Those Divisions where region is xxx. Mean only need to pass A,B,E in a loop in Qlik sense automation.

I am not able to filter out those values in automation block.

Please help me here.

 

Thanks

 

1 Solution

Accepted Solutions
PhilipZ
Contributor II
Contributor II

I solved this using a loop and condition block and replicated your list by adding the rows manually to a Variable.

The full solution looks like that:

PhilipZ_0-1711016844214.png

 

For the loop, I choose the second column as inputs:

PhilipZ_2-1711016946955.pngPhilipZ_3-1711016961902.png

Or just input it as JSON (you will have to adapt the table name according to your input): {$.TestTable[*][1]}

PhilipZ_5-1711017048631.png

 

The condition is an if clause, if the current item in loop equals "xxx":

PhilipZ_4-1711016994678.png

 

For the output, use the current loop index as input for the row (first bracket [{$.loop.index}]) and output the value in the first column (second bracket: [0])

PhilipZ_6-1711017162119.png

 

Running the application, I get the requested output:

PhilipZ_7-1711017223349.png

 

 

Hope that helps

Philip

 

 

View solution in original post

9 Replies
Shai_E
Support
Support

Hi @Ipsita2023 

Would be hard to know without seeing the automation json and the run json log.

 

Best Regards

PhilipZ
Contributor II
Contributor II

I solved this using a loop and condition block and replicated your list by adding the rows manually to a Variable.

The full solution looks like that:

PhilipZ_0-1711016844214.png

 

For the loop, I choose the second column as inputs:

PhilipZ_2-1711016946955.pngPhilipZ_3-1711016961902.png

Or just input it as JSON (you will have to adapt the table name according to your input): {$.TestTable[*][1]}

PhilipZ_5-1711017048631.png

 

The condition is an if clause, if the current item in loop equals "xxx":

PhilipZ_4-1711016994678.png

 

For the output, use the current loop index as input for the row (first bracket [{$.loop.index}]) and output the value in the first column (second bracket: [0])

PhilipZ_6-1711017162119.png

 

Running the application, I get the requested output:

PhilipZ_7-1711017223349.png

 

 

Hope that helps

Philip

 

 

poojask123
Partner - Creator
Partner - Creator

Hi @Ipsita2023  If the solution provided here worked, then can you share your automation json plz. Im trying to do something similar, but the solution isnt working very well with me.

Attaching here my json. @PhilipZ  Can you plz help figuring out what could be wrong .

Here's what I am trying to do - There are 2 fields Email & FilterType. 

2 out of 7 values in the Email field are with FilterType "MLOnly". I need to filter out all the Email's that have a FilterType - MLOnly, my output should be only 2 values from the Email field

salmankojar
Partner - Creator II
Partner - Creator II

Hi @poojask123 can you please explain your requirement once again? So that I can find the issue in your automation as per your requirement.

poojask123
Partner - Creator
Partner - Creator

Hi @salmankojar  I have 2 columns like below (brought it into a table just to show you how they are related). I have to prepare an automation such that, all the E-mail's with FilterType MLOnly are passed into a loop. Once the E-mail values are filtered, I then need to prepare a content that will be shared to these filtered E-mails. 

I am unable to filter the E-mails based on the FilterType value.

Automation JSON is attached

E-mail FilterType
QlikView1@abc.com MLOnly
QlikView2@abc.com BGOnly
QlikView3@abc.com BGROnly
QlikView4@abc.com MLOnly
QlikView5@abc.com MLROnly
QlikView6@abc.com -
QlikView7@abc.com ROnly
salmankojar
Partner - Creator II
Partner - Creator II

Hi @poojask123 ,
i have created a straight table in Qlik app by creating table of your data using Inline script.In automaton i have used that straight table data to filter out your output recipient emails.

salmankojar_0-1733145012120.pngsalmankojar_1-1733145026094.png

 

 

poojask123
Partner - Creator
Partner - Creator

Hey Thank you so much @salman . Din realize it was this simple 🙂 

DanielZandersQlik

You could just use the Filter List Block to get this List, so no need for extra condition in a loop. 

DanielZandersQlik_0-1733152485329.png

 

salmankojar
Partner - Creator II
Partner - Creator II

@poojask123 yea it is simple..just understand the different types of blocks and use them as per your requirements..!!