I have a DataTable as shown below:
And this is the output I want:
If the names and columns can be ordered(A-Z), that would be great as well.
I know how to achieve the output, but not with LINQ, so I was hoping someone could provide some pointers on this.
Help of any kind is most appreciated, Thanks in advance!
Kind Regards,
Ashwin A.K
ppr
(Peter Preuss)
May 10, 2021, 9:23am
2
@ashwin.ashok
we can interpretate the case as a certain kind of transponation.
Lets assume following sample input:
we prepare the target Datacolumn structre by a build datatable for the name column
and do add the ordered country columns
with one go we also do create an array with the country names - newColNames
Finaly we following LINQ dtData will be transposed accordingly the case requirement (flag with *)
Result:
Find starter help here:
Transponation_LINQ_NameCountry.xaml (9.3 KB)
3 Likes
Brilliant as always!
Thank you so much.
Kind Regards,
Ashwin A.K
system
(system)
Closed
May 13, 2021, 12:34pm
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.