Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How can I create a loop that will run until the condition is true. Something like:
If condition equals true -> exit loop, else check again
Best I could think of is using the Loop block with list variable as input, so I can run the loop e.g. 20 times. However, it might be that 500 runs are needed. That is why I need the loop to run until the condition is met.
Hope someone can help. Thanks!
Hi SonTaki
Option1: I've used a simple excel and concatenate function but I'm sure many basic script tools can generate this :).
Option2: I've quickly recreated a similar automation, see attached
last question: Loop/if is not the same as while. We loop over a list, meaning you have a fixed set of runs. Also, having an if condition returning always true does not add value in a flow, you can just skip this and continue your flow.
Hope this helps.
Hi Sontaki
Thanks for your request. Unfortunately, we do not have native support for while loops or to loop x times, where is in an input parameter. I would suggest using our ideation pages to post this as a feature request: https://community.qlik.com/t5/Suggest-an-Idea/idb-p/qlik-ideas
You are suggesting the most used workaround: looping over a list of x items, and exiting when a condition is met.
another, less used method, is using labels:
Hope this helps,
Kind regards,
Thank you very much, Piet! I still have some questions:
Option 1: is there a way to generate a list on the fly, e.g. 1 to 10000, without typing each value individually.
Option 2: this looks interesting, would you be able to post the json file please?
Last question: Instead of the Loop block (as you have it in option 1) I tried with a Condition block "If 1 does not equal 2" which theoretically should run indefinitely until the condition within the loop is met :D. However, the entire automation fails. Do you know why?
Thank you!
Hi SonTaki
Option1: I've used a simple excel and concatenate function but I'm sure many basic script tools can generate this :).
Option2: I've quickly recreated a similar automation, see attached
last question: Loop/if is not the same as while. We loop over a list, meaning you have a fixed set of runs. Also, having an if condition returning always true does not add value in a flow, you can just skip this and continue your flow.
Hope this helps.