How to convert an integer to a text

Solved!
LaurentS
Level 3
How to convert an integer to a text

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

0 Kudos
1 Solution
AlexT
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. 

Screenshot 2021-08-04 at 13.00.16.pngScreenshot 2021-08-04 at 13.00.33.png

Let me know if this helps!

View solution in original post

2 Replies
AlexT
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. 

Screenshot 2021-08-04 at 13.00.16.pngScreenshot 2021-08-04 at 13.00.33.png

Let me know if this helps!

LaurentS
Level 3
Author

Thanks !

0 Kudos