Functions not working

Hello,

I created a new stream machine with a MQTT consumer added by me.
I also created a history table with the values coming in. I wanted to add up the values from the table, but the SUM function does not seem to work (it’s always displaying 0).
I also tried the TIMEAGGREAGATE function and it’s displaying #NA!.

Am I doing something wrong?

(Had the exact same issue in the previous version, now I’m using version 2.0)

Regards,
Ana

Hi Ana,

thanks for the post!

It seems to me that you have almost everything in order but one detail that is a common, small bump when working in a spreadsheet or in programming in general too.

The “value” you are getting is a string that is to say text. You can see this in the inbox. Here the “value” is green which in Streamsheets is the coloring for a string whereas numbers are blue (orange stands for a so-called dictionary).

Mathematical functions, such as the SUM() or TIMEAGGREGATE(), cannot deal with text but need numbers as input.
However, to transform the numbers that your “value” parameter delivers in the format of text to a number format you can use the VALUE() function.
This function tries to convert whatever input it gets to a number.

Let me know whether this does the trick or does not solve the issue.

Best,
Philipp