Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on December 16, 2021 8:55PM
Likes: 0
Replies: 5
Hello,
I am trying to store an ID column as a text/character column and not an integer column. How would I go about forcing the column type of a Dataiku Dataset? I forced it manually when viewing the dataset sample, but when I built the dataset again, it forced it back, interpreting the column as an integer instead of a character, removing the leading zeros.
I also tried to force the column type in the code (I am using R), but it didn't work. Additionally, the same column was interpreted as a character/text column earlier in the flow, but it's interpreted differently later on in the flow in my output dataset.
Please note that no transformations are done on this particular column throughout the flow.
Thank you.
Hi @mrs25
and welcome to the Dataiku Community. While you wait for a more complete response, in terms of padding a number with leading zeroes, I welcome you to this resource in our Knowledge Base: How to pad a number with leading zeros
I hope this helps!
Thank you for this resource!
However, the column has varying lengths of strings, ranging from 5-8 digits, with some requiring varying lengths of leading zeros, so unfortunately, I cannot force pad them.
Welcome @mrs25
,
i add a prefix-character(for example the letter z) to ID-columns with numerical values in order to save leading zero's and force a type. Cheers, -Jurre
Ah I see! I will try this - thank you!
This is a clunky workaround. It would sure be nice if a string of numbers would just be treated as strings.