How to convert an integer to a text
![LaurentS](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar22.png)
LaurentS
Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 21 ✭✭✭✭
Hello,
I am seeking for the equivalent syntax / method or Dataiku to convert an integer in a text. I am seeking for the equivalent python syntax "str(integer_value)" to be used in Dataiku
Thanks and kindest regards
Best Answer
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,211 Dataiker
Hi Laurent,
I assume you are looking for a way to convert integer to text in DSS formula? For example as part of Prepare recipe correct?
https://doc.dataiku.com/dss/latest/formula/index.html
There are 2 functions that should help here :
toString(column_name)
strval("column_name") #must use quotes for strval
Please note toString will drop leading 0's as explained here
By default, we will try auto-detect the meaning but you can change this to "Text" manually.
Let me know if this helps!
Answers
-
LaurentS Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 21 ✭✭✭✭
Thanks !