Concat formula is truncating values

FarSideFeb
Level 3
Concat formula is truncating values

Hello,

I am taking one column which contains values that vary in length from 18 - 32 digits, and putting a single tick mark at the beginning of the number, and at the end of the number.

After typing out my formula concat("'",OrderNBR,"'") my new column, "OrderNBR2", contains truncated order numbers. The original OrderNBR column has the data type of string - text, and is not truncated. IS there a way I can put a "cast" or some other feature into my concat formula to prevent the order numbers from truncating?


Operating system used: Windows

0 Kudos
1 Reply
tgb417

Dataiku and Python tend to do a bit of "Duck Typing" in unexpected places.  I reported a product idea around this here.  https://community.dataiku.com/t5/Product-Ideas/The-ability-to-turn-off-Cell-level-quot-Duck-Typing-q...If this reflects your scenario, you are invited to upvote the product idea.  

There are a number of ways to deal with these challenges.  Regarding the idea of using a Cast statement, One can create recipes using many different tools, partly depending on where your data is stored.

Is your data stored in a SQL database? You might try a SQL recipe and do the computing in the database. In that case, a CAST statement is available to you.  Are you comfortable with Python (or even R) you can create recipes in your flow that use all of the power of those languages?  

Finally, in a visual recipe, you might find a formula step using the format function to be helpful.  https://knowledge.dataiku.com/latest/kb/data-prep/prepare-recipe/How-to-pad-a-number-with-leading-ze... the uses the Java formating syntax.  https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#summary 

Hope one of those ideas might be of some help to you.  Let us know how you get on with your particular use case.

--Tom
0 Kudos