how to convert number to string in custom dimension?

a238e628-a435-4e63-bf80-3f595561f955.png

I used the to_string function here. But it doesn’t seem to work. And if I don’t convert it to string, the function still doesn’t work because apparently value_if_yes and value_if_no have to be the same type. Someone knows what I should do?

0 3 14.4K
3 REPLIES 3

Hi yoonawu!
I had the same issue and reached out Looker support for help. What they explained to me is that to_string is only available for table calculation. In this case, a workaround would be to create the custom dimension and use a specific number to apply for cases greater than 20, and after that use table calculation to adjust the labels and replace the specific number you used in custom dimension with “>20”. For visualization, you would have to hide the custom dimension from visualization. Not the best solution, but it worked. A little warning, you won’t be able to pivot this column.

create the custom dimension

Is this the document?
https://docs.looker.com/exploring-data/adding-fields/custom-measure

concat(${my_number},"")

Top Labels in this Space
Top Solution Authors