I’m pretty new with KNIME and facing a problem when processing my sensor data. The sensor delivering sometimes a single value and sometimes more values (up to 9) in my example. What i want to achieve is, that whenever there are more than on values in the result data row, i want to calculate an average value out of all result values and replace the field. I think that REGEX of LOOP and STRING MANIPULATION could do this, but i could not resolve it.
Hope that someone could help and advise me. Workflow and Data enclosed.
Sensor.zip (8.0 KB)
thank you for providing the example and the beginning of the workflow.
Attached a little workflow that should solve your problem
Sensor_Data.knar.knwf (72.5 KB)
Instead of multiple String Manipulation nodes you can use Column Expressions node. You can find workflow attached.
And you can have up to 10 values
Sensor_Data_ipazin.knwf (72.6 KB)
i really appreciate your work but it only calculates the correct MEAN or AVG in the case when there are exactly 9 values in the dataset. In any other cases the filled “0” values cause an incorrect calculation.
As you could see in the enclosed screenshot e.g. in Row 5 it should write a result of 68.5 but has instead it is 13.7.
In addition, is there a more dynamic way to do this? Maybe tomorrow, i will get 12 values in one row from the sensor…
Thanks in advance
sorry for the mistake!!!
Let’s try again with this one
Sensor_Data.knwf (27.3 KB)
thanks for your contribution. To be onest, i could not find any differences to Kathrins Workflow, especially no Column Expression node. Is it part of an Extension which i have to install first?
this is exactly what i was searching for. Thank you so much for the effort you spent on my Topic. Great
Wrong attachment! slight_smile:
Here is a new one. It is based on number of values you get from sensor.
Regarding Column Expressions node it is part of Knime 3.6 version and you have to install it under Extensions (Knime Labs Extensions).
If you have any questions regarding workflow feel free to ask.
Sensor_Data_ipazin2.knwf (34.5 KB)
thanks for your reply! lean and programmatic way to solve my issue. Great!