# Help Fixing Variable Loop, Table Row to Variable

**URL:** <https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687>\
**Category:** KNIME Analytics Platform\
**Created:** [November 30, 2023, 4:53pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687 "2023-11-30T16:53:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![creedssmith](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@creedssmith](https://forum.knime.com/u/creedssmith)\
**Post date:** [November 30, 2023, 4:53pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/1 "2023-11-30T16:53:46Z")

</div>

In the attached excel file there is a column, “Neighborhood”, with 86 different names. Each neighborhood has pre-required date ranges by year and month via rows.

 ![3](https://forum-cdn.knime.com/uploads/default/original/3X/f/2/f2e3a77766e7ef923706116190eba52ee2ba5edb.png)

[temp.xlsx](https://forum.knime.com/uploads/short-url/eMJSBQ4p0tF8uc0b4HaerQNXIED.xlsx) (1.4 MB)

I am trying to use each neighborhood as a variable to complete the remaining steps via a Loop with a final output for each neighborhood, year, and month. The remaining steps are using Linear Interpolation via the Missing Value node to fill in missing neighborhood data at the Year and Month pre-required time frames.

When I use the Nominal Value Row Filter and run a single neighborhood manually, this workflow works fine. But when I try to automate each neighborhood as a variable, the workflow binds up for hours with no end. All nodes before the Joiner Node with the “!” finish. The Joiner node with “!” never leaves “99%”, and the remaining nodes stay “cued”.

 ![1](https://forum-cdn.knime.com/uploads/default/original/3X/8/0/8060da2fceb2353c233820d2aa5b3002245fc690.png)  
 ![2](https://forum-cdn.knime.com/uploads/default/original/3X/5/f/5f635a4ec57bf4f4d83a5d8dff7c0f956029de8c.png)

I’ve never been successful at introducing variables into loops to work for me. But I need to grow up and make this work for 86 neighborhoods, as this is just too much to deal with manually, one-at-a-time.

I am using version 4.7.7 here. I do have the 5.1 series installed also, but step one of my million step workflow uses the KNIME Read From KML node, not available in later KNIME versions.

[temp.knwf](https://forum.knime.com/uploads/short-url/5l4ebrG4yNNYhirRhpxmYmqQwI1.knwf) (66.2 KB)

Please tell where I am screwing up, so I can grow up and learn to use variables and loops. The excel data and workflow are attached. Thanks!

---

<div class="post-metadata">

**Author:** ![ArjenEX](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/97f17d/32.png) [@ArjenEX](https://forum.knime.com/u/ArjenEX)\
**Post date:** [November 30, 2023, 9:23pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/2 "2023-11-30T21:23:46Z")

</div>

Hi @creedssmith

I might be understanding you wrong but this should get you sorted out:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/7/2/727e0d2e260b2d7586c123b110f98fa8ff10b2e3.png)

If I understand it correctly you want to replace the missing values **per neighborhood** with the linear interpolation.

What you try to achieve in your current workflow is something that the Group Loop Start node does automatically for you. All rows which have a common value in the columns you define as to be Included are considered to be one group. In your case, that’s the column neighborhood.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/b/bb85d51b5a85bb25f017ae2bc87dfe7fac455feb.png)

The node will iterate through all groups it finds automatically. Below is an example of one iteration, all records for _Eastridge, Crosspointe, Crosspoint, Highlands Ranch CO_

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/6/e/6e2eea01f8513b53bb993e126710723de005a405.png)

Because of this, you only need one Missing Value node which you can populate with all the columns you would like to supplement with the linear interpolation.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/f/ffed18292372100654c206bed74a20f3255480d4.png)

Below are your before and after of one neighborhood.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/4/a/4acc3c414354e23d42dda2e4c73354c2e06b6a62.png)  
After:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/2/e/2ee7963a75d70c71361ebdaca5ff9f942f9f3b04.png)

It’s light work for KNIME to perform this, it takes about 5 seconds to process the entire file. No flow variables are required here. In case you want to perform some other actions, a nice feature of the Group Loop that it also automatically stores the group that it’s currently processing as a variable.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/e/3e08a34c7ddf4e9742519ca243917fbbb57f8103.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![hmfa](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/9fc29f/32.png) [@hmfa](https://forum.knime.com/u/hmfa)\
**Post date:** [November 30, 2023, 9:51pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/3 "2023-11-30T21:51:30Z")

</div>

Hi @creedssmith, as @ArjenEX explained, you don’t need variables for that, because group loop and Missing Value node can handle all your needs

![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/0/d0e6325a35eb57852bb332c788e7322583cc0a2c.png)  
Try this workflow and thanks for @ArjenEX explanation

[Neighborhood\_loop.knwf](https://forum.knime.com/uploads/short-url/3dh2euVEgRUF7sDfD1kz1er43Hz.knwf) (1.5 MB)

Br

---

<div class="post-metadata">

**Author:** ![creedssmith](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@creedssmith](https://forum.knime.com/u/creedssmith)\
**Post date:** [December 1, 2023, 11:59am UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/4 "2023-12-01T11:59:04Z")

</div>

@ArjenEX @hmfa AH!, so I made it a more complex workflow than I needed ☹

Let me clean up my mess and try your simple solution. I guess I am not grasping how best to use variables and need to find a clean video presentation on the subject.

Thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![hmfa](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/9fc29f/32.png) [@hmfa](https://forum.knime.com/u/hmfa)\
**Post date:** [December 1, 2023, 10:26pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/5 "2023-12-01T22:26:42Z")

</div>

Hi @creedssmith

Take a look at this one.  
Maybe it can inspire you.

[![](https://img.youtube.com/vi/EvcRiQea3FA/maxresdefault.jpg "Flow Variables") ](https://www.youtube.com/watch?v=EvcRiQea3FA)

Br

---

<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:** [February 29, 2024, 10:27pm UTC](https://forum.knime.com/t/help-fixing-variable-loop-table-row-to-variable/75687/6 "2024-02-29T22:27:25Z")

</div>

Closed on February 29, 2024, 10:27pm UTC

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