Hi everybody. i have a question about an error i faced with.
I write this expression and it doesn’t work.
//mean = (round(average(column(“201801”),column(“201802”),column(“201803”)),2)) * 1000
the error is:
An error occurred during the execution of the script in function ‘average’ at line 1: The provided element ‘105’ of type ‘String’ is not a valid number.
i changed the type “string” but the same error is showed.
if you can, please, show the data that you are working with. The error says that in one/some of the columns (201801, 201802, 201803) you have not a number values (integer of double), but a string (text).
As @alex_never said you have at least one column of type string. You can convert the column to a numeric type like integer or double by using the String to Number node or simply use the toInt() or toDouble() functions in the Column Expressions node to convert the type of the column(s).
mean = round(average(toInt(column("201801")),toInt(column("201802"))),2) * 1000
And after that in join statement don’t forget to use “string(mean)” instead of “mean”, otherwise you will get another error message.
Not in the Column Expressions node. But yes, in the String Manipulation node, all the arguments of the join() function must be string.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.