Repeat data according to criteria / Rule Engine

Good afternoon everyone, how are you?

I need help, in this case sent via print below. I have two trips scheduled for 11/06.

In the first one, I have a loading and unloading schedule. In the second one I don’t have it, in this case I would like it to repeat the time filled in the previous line.

@takbb I believe that a Java script can meet this need, correct?


Hi @Gabriel2020 , for this case the Missing Value node is the better option. (I’m assuming the “?” are missing values!)

For each of those columns, tell it to copy previous value where the value is missing.

2 Likes

Not really, because it needs to analyze origin, destination and day of the week, and needs to repeat the last one filled in.

Hi @Gabriel2020 I don’t understand why the above solution won’t work. If the last populated value isn’t for the same origin, dest etc, then what value would you use?

As always, posting some actual data rather than screenshots, and a full clear description of the exact problem you are trying to solve would make it easier to help.

Maybe post a copy of your data showing the circumstance where missing value node is deficient, and what the required outcome is.

In this example, REC-02, it doesn’t have anything before, but it was filled in with the REC-01 number.

I sent the Workflow above. it was clear ? If it wasn’t, I apologize, I may have explained it wrong, or misconfigured the Node.


Unfortunately it wasn’t clear to me and I’m afraid it still isn’t.

So you want it filled with the previous value, but not always. I’ve reread your initial post and it doesn’t mention any conditions. What are ALL the conditions when it should take the previous value? It is quite possible that a java snippet will again be the solution, but only with a clear definition of the problem.

And no you didn’t send a workflow. By “sending a workflow” I mean uploading a workflow.

Also, from memory of your earlier posts, are you putting the missing value node inside your “group loop” or outside?

Ok, I apologize again and thank you even more for the partnership that has been increasingly incredible.

Case 1:

06/11/2023 - MG-02 => BHZ-03

In the first case I have a time being 06:30 / 08:30 and 11:00, in the second case there is no time and it is missing. Therefore, it should contain the same schedules.

Case 2:

REC-02, as you can see in the print, it only exists for 2023-11-06, so it remains missing

Case 3:

I have 3 departures and only 1 with a timetable, so the others must be completed with the first, same as case 1

I think part of the problem I’m having is trying to remember what your columns represent as you aren’t including the column names in your screenshots.

So is the rule, that the values in the section marked in blue are copied down if all of the values in red are the same as in the previous row?

1 Like

That’s exactly it, I forgot to share the file, I’ll forward it to you now

KNIME_project234.knwf (215.6 KB)

@Gabriel2020

I suggest for simplicity, put the Missing Value node into a Group Loop. That should do what you require. i.e. Group Loop on the columns in Red, containing Missing Value on the columns in Blue.

image

Hopefully that will work.

2 Likes

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