Discussion Board for collaboration related to QlikView App Development.
Is there any way to split a column into multiple columns? I cannot use subfield because there is no identifier.
I need to divide a column into multiple columns using number of characters. Every 3 characters belong to column
my data structure will look this
Each cell has 54 characters in one column
Now need to show in output, 18 columns with 3 characters in each cell.
Let me know if i can use subfield here as i am not sure what will be the delimiter.
Every 3 characters form a cell in the output
Thanks a lot
I am sending you a simple script for splitting columns by using fixed number of characters. You just have to transform the data in the structure you need, if you want to have them in columns.
[input]:load * Inline[productcode,dataA11,00A00A00B00A00A00A00C00A00A00B00C00A00A00B00C00C00C00AB11,00B00D00B00D00A00A00C00A00D00B00F00C00A00D00D00F00D00C];
[output]:noconcatenateloadproductcode,rowno() as row_id,mid(data,iterno()*3-2,3) as Xresident inputwhile iterno()<19;
drop table input;
Hope it helps,
View solution in original post
First, use Crosstable load to create Column1, Column2... dimension. Then define 18 fields with Mid() function.
CrossTable(Columns, Data) Load
Mid(Data, 1,3) as "1",
Mid(Data, 4,3) as "2",
Mid(Data, 7,3) as "3",
Mid(Data, 51,3) as "18",
Its obvious and simple way but not smart
Thanks Maria, it worked