# Loop for vehicle definition

**URL:** <https://forum.knime.com/t/loop-for-vehicle-definition/83445>\
**Category:** KNIME Analytics Platform\
**Created:** [September 23, 2024, 6:45pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445 "2024-09-23T18:45:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel2020](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel2020](https://forum.knime.com/u/Gabriel2020)\
**Post date:** [September 23, 2024, 6:45pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445/1 "2024-09-23T18:45:22Z")

</div>

Good afternoon everyone, how are you?

Next, I need a lot of help.

1° I have a table with the forecast (Expected value for collection)

2° I have a table with the vehicle profile and capacity of each vehicle for a given region and the quantity I have available.

I need the best vehicle profile to be defined for each route and subsequently deducted from my stock. I will send some cases as an example.

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

example 1:

The last column is a division I made between forecast / capacity.

In this case, the ideal vehicle is the VUC as it has 60% and the others are above 100%.

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

And I had 6 VUC available, as this profile was selected it needs to be decreased to 5.

If the best option is zero, you should go to the 2 best.

Example 2 :

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

For this case I have a forecast of 27565 and my largest vehicle available is 1900, so I need 14 to meet this need, I need you to check if I have that quantity, and duplicate this line 14 times for example.

---

<div class="post-metadata">

**Author:** ![Gabriel2020](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel2020](https://forum.knime.com/u/Gabriel2020)\
**Post date:** [September 23, 2024, 6:50pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445/2 "2024-09-23T18:50:54Z")

</div>

[Knime\_definição veículo.knwf](https://forum.knime.com/uploads/short-url/zqjpJspPv7wxBmEsH4WlYdejYQ4.knwf) (137.4 KB)

Follow the file

---

<div class="post-metadata">

**Author:** ![Gabriel2020](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel2020](https://forum.knime.com/u/Gabriel2020)\
**Post date:** [September 23, 2024, 6:56pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445/3 "2024-09-23T18:56:00Z")

</div>

@iCFO It’s something very similar to what you helped me with in the past, could you help me again please?

> [@General summase](https://forum.knime.com/t/general-summase/73400/16):
>
> thanks @iCFO . I haven’t incorporated the “week grouping”, but I’m guessing that is where you ended up heading on the other thread. I thought I’d uploaded this though. Perhaps the week groups can be incorporated back in relatively easily? I may be returning the favour and asking you for your assistance on working that back in here… wink@Gabriel2020 , please take a look at the attached. I decided to ditch the java snippet that I posted before and instead make use of the alternative which uses…

---

<div class="post-metadata">

**Author:** ![mwiegand](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mwiegand/32/66896_2.png) [@mwiegand](https://forum.knime.com/u/mwiegand)\
**Post date:** [September 25, 2024, 7:57pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445/4 "2024-09-25T19:57:49Z")

</div>

Hi @Gabriel2020,

I had a look ad your data and struggle to help you because there is no explanation to the column names and their values. If you could provide that context, support would be much easier.

Best  
Mike

---

<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:** [December 24, 2024, 7:58pm UTC](https://forum.knime.com/t/loop-for-vehicle-definition/83445/5 "2024-12-24T19:58:13Z")

</div>

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