Skip to main content
Solved

Concatenating fields on the IDE


Forum|alt.badge.img

I want to create another column using the filter step on the IDE. How do I concatenate foreign characters and fields with different data types into one field.

Fields to concatenate is date field, special character (/), string and integer fields

Best answer by ivan.kozlov

Hi Gloria,
You can use the tostring() function to convert data to string but to make this work you also need to specify the format of the data.
For example toString(date_col, 'yyyy-MM-dd') to get 2023-05-30 date. You’ll need to provide the right date format.

Here’s a link to ONE Expression documentation:
https://docs.ataccama.com/one/latest/common-actions/one-expressions.html

So the whole expression can look like this:
toString(date_column_name, “yyyy-MM-dd|”) + toString(integer_column_name) + “/” + string_column_name

Hope this helps,
Ivan

View original

Forum|alt.badge.img

Hi @Gloria ,

To create a new column you need to use Alter Format step. Filtering step helps to filter the records. You can use alter step and concatenate the fields you mentioned in the expression - tostring(date) + '  ' + integer + '  ' + special_characters + '  ' + string .  Let me know if you are looking for something else.

Hope this helps !

Regards,

Srija Piratla


Forum|alt.badge.img
  • Universe Traveller
  • July 25, 2024

Hi @srija piratla, I tried this but I got this error 

 

Function 'toString' is not applicable for arguments {DATE} 


Forum|alt.badge.img

Hi @Gloria ,

I used tostring as my DATE datatype is string. If your datatype for date is not a string. Please don’t use tostring().

Regards,

Srija Piratla


ivan.kozlov
Ataccamer
Forum|alt.badge.img+3

Hi Gloria,
You can use the tostring() function to convert data to string but to make this work you also need to specify the format of the data.
For example toString(date_col, 'yyyy-MM-dd') to get 2023-05-30 date. You’ll need to provide the right date format.

Here’s a link to ONE Expression documentation:
https://docs.ataccama.com/one/latest/common-actions/one-expressions.html

So the whole expression can look like this:
toString(date_column_name, “yyyy-MM-dd|”) + toString(integer_column_name) + “/” + string_column_name

Hope this helps,
Ivan


Forum|alt.badge.img
  • Universe Traveller
  • July 29, 2024

Hi Ivan, this was useful, thank you


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings