Numerical variables in calculated field with parameter

Hello everyone,
I am trying to create a calculated field to filter through a parameter I just created using
ifelse(${Parameter}=‘column1’,{column1},
${Parameter}=‘column2’, {column2},
${Parameter}=‘column3’, {column3},
column4).

All of the columns are converted to dimensions, but while 3 of them are strings, one of them is a numerical variable (integers to be more specific). When I try putting this numerical variable in the calculated field, I won’t be able to save it as I will get an error message.

Is there a way to fix this?

Hi @tancredidorsi ,

Yes, that’s correct. A calculated field can only return a single data type. So if, for instance, column1, column2 and column3 are strings, but column4 is an integer, then it won’t save.

The easiest way to fix the error is to use the toString() method (here).

So you’d return toString({column4})

That may or may not solve your larger problem, but you’ll get past the calculated field error.

ws