LOOP CONTROL

Hello group,

I need your help!

I have a table1 with 2 columns, 1st is a reference and 2nd is a parts position that configure of reference.

image

I have a table2, where I have a dictionary with the position of the pieces that combines with the reference AREA.

image

I want to get whether the reference is FRONT, RIGHT, LEFT or REAR according to table 1, but you can see that there are multiple combinations.

For example, if I look at table one and get the reference 51123 it should classify me as FRONT.

If I have a 63333 it would be classified as RIGHT, because 2222 is shared with FRONT and RIGHT, but it depends on another position that is associated to the reference in concrete …
and if for example, there are some positions in different areas, the result should be FULL EQUIPMENT.

I want to make a workflow where I can sort each reference by FRONT, RIGHT, LEFT, REAR or FULL.

*Another question, how can I automatically run all the references in the workflow?

THANKS ALWAYS

Hi @26AngelG,

may I ask to share the entire or a sample of the date please? Ata first thought you could use a value lookup or joiner node to accomplish what you need.

Best
Mike

2 Likes

Hi @26AngelG , in addition to uploading some data, it may be just me but I think you might need to provide a fuller explanation of your rules.

Why would 51123 be classified as FRONT, when it has both position 0111 (FRONT) and 0222 (RIGHT) ?
And if it’s because FRONT is the only “area” that has both positions 0111 and 0222, then why is 63333 to be classified as RIGHT, just because position 0222 is “shared with FRONT and RIGHT” but you are then free to ignore 0444, 0555 and 0777?

I’m afraid I have yet to see the pattern in what you are describing.

What do you mean by “if there are some positions in different areas, the result should be FULL EQUIPMENT”? (Does 63333 not have “positions in different areas” ?)

I feel that there must be some subtle rules here that you understand but haven’t fully conveyed.

3 Likes

Hello @takbb ,

Thanks for replying!!!

Sorry for my poor explanation! I’ll see if I can clarify it better.

Through my table I try to explain it.

image

If only one of the following combined positions appears:

If it’s 0111 or 0222 or both → FRONT
If it is 0333 or 0444 or both → RIGHT
If it is 0555 or 0666 or both → LEFT
If 0777 → REAR

Combinations:

If 0333 or 0444 and/or 0222–> RIGHT (e.g.: 0333 / 0222)
If 0555 or 0666 and/or 0111 → LEFT (e.g.: 0555 / 0666 / 0111)
If 0777 and/or 0444 or 0666 → REAR (e.g. 0777/ 0666)
IF it is 0111 or 0222 and 0333 or 0444 and 0555 or 0666 or 0777 (there are positions of the 3 of the above 4 groups, whichever they are) → e.g. (0111, 0333 and 0555 → FULL EQUIMENT)

I will try to send the complete file to you and @mwiegand to the one who also made the effort to help me.

Thanks again

Hi @26AngelG , I think I have a little way to go yet before I fill my understanding gap. :wink:

I can see the rules you have written, and I can see your tables, but I still don’t understand how to infer the rules from what is written in the table.

e.g. Do you only ever look at the last two (non-missing) POSITION columns for a particular AREA?

For example, why is it that 0111 or 0222 or both → FRONT
but 0222 or 0333 or both is not RIGHT ?
yet “0333 or 0444 and/or 0222” → RIGHT
incidentally, I think you probably need to clarify your usage of AND and OR here… perhaps use brackets to denote explicit precedence of AND and OR in such statements, as I can read “0333 or 0444 and/or 0222” in multiple ways.

Sorry if I’m just being slow today!

1 Like

Sorry for my explanation @takbb !!!

I try to explain better! I did new tables:

Dictionary reference table:

1Âş FRONT: mandatory position 0111 or 0222 (alone) o both.
2Âş RIGHT: mandatory position 0333 or 0444 (alone) or both, and if also is 0222 (optional).
3Âş LEFT: mandatory position 0555 or 0666 (alone) or both, and if also is 0222(optional).
4Âş REAR: mandatory position 0777, and if also is 0444 or 0666(optional).
5º FULL EQUIPMENT: Minimum 3 different positions code in 3 areas (front/right/left), (front/right/rear), (right/left/rear)…

I attach a picture for better understanding:

I only want depending position appear in list, classify the reference of part affected.

I put a expample in table

Data table expample:

image

I hope that you understand better (sorry for your time)

Hi @26AngelG and @takbb,

Taking a few steps back here as I believe there is quite a simple way to identify the AREA based on the Position-Values.

When dealing with awfully complex data and reaching some sort of data-sound-barrier that one might believe is impossible to cross, I asak myself “how else could it possibly work”. One major conclusion always was finding another representation of the data.

I concluded that, in pretty much all cases, the best table, is no table. Not quite but if you flatten the structure using unpivot, looking up data becomes quite simple. Combining that with a Rule Engine to extract the Row Index, it allows you to reestablish the original table structure later on.

Coming back to my thought. After you unpivot you get single Postion-values for each Area value. You then do a simple Value Lookup and can decide if you wanat to sort asc or desc by aa certain position-value to filter the first, last or whatever.

That filtering can be accomplished using a groupby and select first for the position-valaue, doing a group list loop start for each area or using a duplicated row filter. So many possibility if you flattened the data :wink:

If you like me to provide a test workflow, please share the sample data.

Cheers
Mike

1 Like

Hi @mwiegand!!

Thanks for your add…I will try to study it because I am not capable to do it, I am very nobel in KNIME :slight_smile:

I would like to do a loop with the reference for scroll down the list one per one, and I will add in a table all the different possibilities by FRONT, RIGHT, LEFT, REAR and FULL EQUIPMENT.

Hi @takbb,

did you manage to close your understanding gap because I still struggle especially because I see little continuity in the screenshots provided and the explanation given. I really want to help but since my previous comment seems to have not been quite helpful, I feel adding more ideas won’t bring us close to helping him out.

Maybe you got a different understanding of the support request …

Cheers
Mike

1 Like

Hi @mwiegand , I was rather hoping you’d worked it out and that I was simply overlooking something. :sweat_smile:

@26AngelG
I’m closer than I was, but I’m struggling with the specific examples (which isn’t aided by now scrolling up and down the thread) so I am reproducing some of what you have said so far, to put things in one place

Original Table 1
image

Recent “Rule Lookup table”

Rule “explanation” table (I take o to be “or” and y to be “and” in Spanish)
image

So let’s look at the original examples given (initial post):

Example 1

For example, if I look at table one and get the reference 51123 it should classify me as FRONT.

So looking at Table 1
“51123” has positions 0111 and 0222
Looking in Lookup table for 0111 AND 0222, we get FRONT.
I believe I understand that one :slight_smile:

Example 2

If I have a 63333 it would be classified as RIGHT, because 2222 is shared with FRONT and RIGHT, but it depends on another position that is associated to the reference

Now this is where my understanding gap continues to exist.
Looking at Table 1
“63333” has positions 0222, 0444, 0555, 0777
We are told that 63333 is to therefore to be classified as “RIGHT”
Why?
“0222” alone or with “0111” in the lookup table results in FRONT
but an optional “0222” in conjunction with “0444” (line DDDD) results in RIGHT.
So I can see how it might be RIGHT.

However, doesn’t it also have “0555” and “0777” ? … and “0555” together with “0222” makes “LEFT”, whilst “0777” either alone or combined with “0444” makes “REAR” so I still don’t understand why “RIGHT” is to be chosen in preference to either “FRONT” or “LEFT” or “REAR”.

Perhaps there is some order of priority to the rules, and I think this is what I don’t yet understand?
Can you provide a fuller explanation for that specific example please. I’ll probably then have further questions :wink:

Like @mwiegand says, we want to help with this challenge but we need to fully understand it before we can suggest useful solutions.

Edit:
I’ve overlaid the references for 63333 onto your area/position diagram to see if that aids my understanding, but I still can’t quite see it:

the markers (1), (2) and (4) visually/physically indicate that this is more RIGHT than it is FRONT. Is that it? Are we having to base this on whether the combined set of positions gives some kind of physical weighting towards a particular area? Is the above diagram suggesting it is more RIGHT than REAR? I don’t know :thinking:

2 Likes

Hi @takbb, when I think I got an idea, I look at the data again and feel left in shambles.

What really makes me scratch my head are the duplicated position values that reference a different area like 0222. Even by factoring in some columns take precedence (mandatory vs. optional) over others, which could be handled as a weight based on the column number or so, the sample data makes little sense to me.

I’d like top reiterate @26AngelG, can you share the sample data please?

Best
Mike

1 Like

Sorry for answer later!!

I am going to share with you the original date ( I tried with a simple example for better understanding but I saw that it is the same difficult :blush:)

Clasify zone by expediente.knwf (16.7 KB)

(If you don´t see it, tell me please)

I want to classify the impact in a car:

I share the position parts by zone:

FRONT:
0281
0283
0471

RIGHT:
1482
1782
3080
2934

LEFT:
1481
1781
3079
2933

REAR:
2581
2582
2583
2585
2931
3900
3901

But the problem is the corner:
0741 (front left corner)
0742(front right corner)
3481 (rear left corner)
3482 (rear right corner)

Front left corner (0741) could associate with FRONT and LEFT, Front right corner (0742) with FRONT and RIGHT, Rear right corner (3482) with REAR and RIGHT and Rear left corner (3481) with REAR and LEFT, depending the previous position

FULL EQUIPMENT:
This is when there are minimum 3 position parts in 3 zones diferents (FRONT, RIGHT, LEFT) for example 0281, 1482 and 1481 (indiferent to the zone affected)

I share the KNIME Workflow, where I need to go expediente by expediente and tell me which is the zone affected.

(Sorry I am not very expert in KNIME)

Hi @26AngelG , Unfortunately in your workflow, you haven’t included the data, because that is on your local machine. Can you upload the csv file here please.


Ignoring KNIME and data tables for the moment, can you explain in simple terms how you would achieve what you want to achieve manually (if no computers were involved). As one of my systems analysis friends would say “Explain it to me like I was a 5 year old”.

eg you might say something like "I have as list of parts that can be on one of four sides or one of 4 corners of a vehicle, and I want to determine, based on the particular parts that were damaged in a collision, which side of the vehicle is most affected.

To do this, I would inspect the parts, find which side of the vehicle they each belong to. Then based on… I would determine … and if they belong to more than one side of the vehicle then… " etc

Because at the moment to me, this isn’t yet a KNIME “how to” question but more a “what am I trying to achieve, and how would I define the specification” question.

Variables influyentes_1 1.xlsx (19.5 KB)

Variables influyentes_1 1.xlsx (19.5 KB)

Conditional Position by Expediente.csv (2.3 MB)

*Sorry I had to discard a lot of data because only allow 4MB

OK! Voy a intentar.

Yo tengo un listado con expediente, el cual lleva asociado unas piezas (posiciones), yo quiero saber en funciĂłn de las piezas que tipo de golpe es: Delantero, izquierdo, derecho, trasero o completo.

Tengo un listado de las piezas que componen cada parte, pero las esquinas podrían ir en la zona delantera o izquierda, trasera o izquierda… en función de las demás piezas habidas:

  • Si en el expediente hay piezas de la zona delantera y además la esquina, el golpe seria delantero, sin embargo, si en el expediente hay piezas de la zona derecha y la esquina, el golpe será derecho. (y de esta forma con las 4 esquinas)

  • El otro caso que tengo es: que si existen piezas de 3 zonas diferentes (una delantera, una trasera y una lateral) es golpe es completo, por todo el vehĂ­culo.

2 Likes

Thanks. For reference chatgpt translation is

OK, I’ll try.I have a list with records, each associated with some parts (positions).

I want to know, based on the parts, what type of impact it is: Front, left, right, rear, or complete.

I have a list of the parts that make up each section, but the corners could be in the front-left, front-right, rear-left, or rear-right… depending on the other parts present:

If the record includes parts from the front and also a corner, the impact would be considered front.

However, if there are parts from the right zone and the corner, the impact will be right. (and likewise for the other 4 corners)

The other scenario I have is: if there are parts from 3 different zones (front, rear, and one side), the impact is considered complete, affecting the entire vehicle.

@26AngelG … Thank you. I will study this.

1 Like

Ok, what I could derive is this rather simple logic. Please confirm if that is correct or not:

You @26AngelG wrote

I want to know, based on the parts, what type of impact it is: Front, left, right, rear, or complete.

I have a list of the parts that make up each section, but the corners could be in the front-left, front-right, rear-left, or rear-right… depending on the other parts present:

If the record includes parts from the front and also a corner, the impact would be considered front.

However, if there are parts from the right zone and the corner, the impact will be right. (and likewise for the other 4 corners)

The other scenario I have is: if there are parts from 3 different zones (front, rear, and one side), the impact is considered complete, affecting the entire vehicle.

Which translates to these rules:

  1. If only a corner or side is impacted, that part takes precedence (apparently)
  2. If a site, whenever front, rear, left or right, and a corner is impacted, the side takes precedence
  3. If more than one side is impacted, the entire vehicle is impacted

Though, this leaves one scenario out where two sides are impacted like front and back, with or without a corner, i.e. in case the car #1 from behind damaged a car #2 in front which resulted in a second collision of car #2 because of the push.

Furthermore, upon close inspecting the data, there is no clear correlation because the data likely requires sanitization. as position codes with just three numbers have a leading zero:

So these:

POSITION AX CODE
0281
0283
0471
0742
0741

Are actually:

POSITION AX CODE
281
283
471
742
741

Here is a possible solution for you:

Let me know if that works or is a starting point for you.

Cheers
Mike

2 Likes

Wonderful @takbb!!! you explain better than me… I am very greatfull!

I hope your answer!!!

Hello @mwiegand!! thanks for your great effort!!

I would like to clarify some things:

  • Respect the data, I have to sort by “Expediente” because this “expediente” has serveral position parts, and for this reason I should scroll expediente, one per one, and finally get the stroke type
  • You have reason in point 2, maybe the logical should sort “complete” in this case (with 2 sizes affected)
  • All positions have 4 letters, for this reason some beginning positions start by 0 (I could solve put all in String)

I will check ASAP because today and tomorrow is party in Spain and I am on a trip (sorry).

THANKS FOR YOUR HELP!! incredible

We continue in contact…

1 Like

Thanks @26AngelG. I’d appreciate if you could mark my post as the solution.

Best
Mike

1 Like

Yes of course, I will do it … but I don´t know how could I do? (sorry)

In other hand, I have been seeing your workflow, and it only classify in 3 areas:

  • 1 impact,
  • corner impact
  • full.

image

Maybe I explained badly (sorry), but I would like to know, How could I do so that this 1 impact o corner impact will by classify in FRONT, LEFT, RIGHT or REAR?

Thanks