# Loop within Loop (variable)

**URL:** <https://forum.knime.com/t/loop-within-loop-variable/71762>\
**Category:** KNIME Analytics Platform\
**Created:** [August 16, 2023, 11:12am UTC](https://forum.knime.com/t/loop-within-loop-variable/71762 "2023-08-16T11:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TobiasLanger](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/t/82dd89/32.png) [@TobiasLanger](https://forum.knime.com/u/TobiasLanger)\
**Post date:** [August 16, 2023, 11:12am UTC](https://forum.knime.com/t/loop-within-loop-variable/71762/1 "2023-08-16T11:12:04Z")

</div>

Hi everyone,

I struggle with creating a Loop within a Loop. I already found the article with the URL below. But sadly the solution of a second Variable Loop End doesn’t lead to a different solution. Only the first iteration of the first loop is executed.  
My goal in this loop is to execute for the first loop variables always the steps of the second loop within.  
I provide a simplified picture of the loop because the original one may contain company information.

Help would be much appreciated. Thanks a lot!

> [@Make one loop in another loop](https://forum.knime.com/t/make-one-loop-in-another-loop/19153):
>
> Hi everyone ! i’m new as a knime user and i’m facing a little problem. I would like to make a loop inside another loop but when i’m testing this, the second loop start stop at one iteration. This is a picture of my workflow. My objective is to do like a double loop for in programming language but on knime. Thank you for your help ! Adrien

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/0/5/05ed935a4740fcff729f3c0eb8aae8368a381518.png)

---

<div class="post-metadata">

**Author:** ![ssq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ssq/32/42118_2.png) [@ssq](https://forum.knime.com/u/ssq)\
**Post date:** [August 16, 2023, 5:49pm UTC](https://forum.knime.com/t/loop-within-loop-variable/71762/2 "2023-08-16T17:49:28Z")

</div>

Hi,

I have used up to four nested loops, with the innermost a recursive one to boot.

It’s a struggle to get them right, but use the Select scope option on the context menu to see if the nesting is correct, and use single stepping to debug. The biggest problem was using variables, especially currentIteration.

Can’t give better help without actually having the real workflow.

Cheers,  
Sam

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [November 15, 2023, 9:34am UTC](https://forum.knime.com/t/loop-within-loop-variable/71762/4 "2023-11-15T09:34:05Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
