You can translate the question and the replies:

How to split column into more columns

Hi teams, I have one column, the content is *60 X 30 X20 mm*. Now I want to split them into three columns call length, width, height. The delimiter is 'X'. How can I implement it? When I use the function SPLIT, the column includes an array. How to convert the array into 3 columns? Thanks.
user
12-01-2024 03:33:39 -0500
code

1 Answer

Hi, I was able to convert an array into columns with a selection view over a view with the array. In the output tab, I created a new field with the field expression `viewwitharray.splitresult[0].string` for the first item in the array, and similarly created new fields for more items in the array. If you want to just use a VQL query, you can do the SPLIT in a subquery and retrieve elements of the resulting array for the columns, like this: `SELECT dim_array[0].string AS length, dim_array[1].string AS width, dim_array[2].string AS height FROM (SELECT SPLIT('X', field1) AS dim_array FROM bv_dimensions);` Also, here's a similar community question with some more information on what you can do with the resulting array from a SPLIT. https://community.denodo.com/answers/question/details?questionId=9064u000000Cf4vAAC&title=How+to+convert+rows+to+columns+using+SPLIT+function%2Fany+generic+function+in+Denodo Hope this helps!
Denodo Team
18-01-2024 11:44:54 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here