Starter Help - Count with values in Text Field

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.

Kind Reagrds,
Andreas

Sensor.zip (8.0 KB)

Hi Andreas,

thank you for providing the example and the beginning of the workflow.

Attached a little workflow that should solve your problem :slightly_smiling_face:

Cheers,
Kathrin
Sensor_Data.knar.knwf (72.5 KB)

Hi Andreas,

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 :wink:

Sensor_Data_ipazin.knwf (72.6 KB)

Br,
Ivan

1 Like

Thanks Kathrin,

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

Andreas

Hi Andreas,

sorry for the mistake!!!

Let’s try again with this one :slight_smile:

Cheers,
Kathrin
Sensor_Data.knwf (27.3 KB)

1 Like

Ivan,
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?

Kind Regards
Andreas

Hi Kathrin,

this is exactly what i was searching for. Thank you so much for the effort you spent on my Topic. Great :slight_smile:

Kind Regards
Andreas

1 Like

Hi Andreas!

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)

Br,
Ivan

Hi Ivan,
thanks for your reply! lean and programmatic way to solve my issue. Great!
Thx again

1 Like