Hi @rfeigel , in this case, the data supplied by @Adrix isn’t actually a screenshot and can be copied/pasted, which is better than many “sample data” examples that get posted .
If you drop the following component onto a workflow you can paste all the text into its config and it should give you the table which reduces the effort needed.
Sorry , as mentioned by @takbb the data is in copy paste mode
I thought that for a simple set would be easier to copy and paste in excel and past again in a table in knime than have a file to download
But i forgot that data scientists and eng are alergic to Excel.
saved a workflow with the sample data :
1- Use the groupby node just for count the information from this column (error/ok);
2- use the row split node to separate the information and see from the output a total rows;
3- can use column expression to use a count formula.
@denisfi
Thanks for taking time to help
Not sure if i understood what you mean.
If i count I will get
And the relevant info will no longer available
Reading from the first row to the last we have
3 days in error
6 days ok
1 day in error
2 ok
1 day in error
…
… 4 days in error
…
…
So the max numbers of day that i was in error was 4 .
The main requirement here is finding a way to identify the “groupings”. After that, it becomes a relatively trivial exercise to then count the members of each group, and find the maximum. The groupings in this case are identified by change of value in the Results column.
One possible solution borrows (steals! ) from the solution provided by @HansS from a “similar” scenario
which I have adapted to your problem.
Since this topic returns frequently I’ll throw in another alternative in case people find this topic again. Added bonus is that it’s about 50% faster.
First step is to lag the column, second step is to use a Java Snippet that analyses all the values stored in a Hashmap.
Map map = new HashMap();
List pair = new ArrayList();
pair.add($Results$);
Integer i = (Integer) map.get(pair);
if (i == null || !$Results$.equals($Results(-1)$)) {
i = new Integer(1);
} else {
i = new Integer(i + 1);
}
map.put(pair, i);
return i;