Hi,
I have the table
I would like to receive this format of data:
Any suggestions?
Hi,
I have the table
I would like to receive this format of data:
Any suggestions?
@Krzysztof
lets build an empty datatable with the target structure:
let retrieve the company column names for a later lookup:
lets do the detransponation with following LINQ:
(From d In dtData.AsEnumerable
Let mr = d.ItemArray.Skip(1).Select (Function (x, i) New Object(){d(0),Companies(i), x }).ToArray
From ra In mr
Order By ra(1).toString
Select dtResult.Rows.Add(ra)).CopyToDataTable
Line1 - iterate over the data - refernce looped row with r
Line2 - create the rowArray for the target rows:
Line3 - iterate over the result of mr
Line4 - order it by the company name
Line5 - add the item to the target datatable
Result:
find starter help done with a LINQ here:
Datatable_DeTranspose.xaml (9.8 KB)
How to add variable type String? I have never used it so far:(
on variable panel:
2nd step:
IT WORKS! THANKS A LOT!!!
Perfect, it is working
take your time for doing the final testing. May we ask you to mark afterwards the solving post as solution. So others can benefit from it, when a similar case is researched.
Thanks
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.