Complicated Case

Hello guys,

I am handling a complex case and would like to seek some help.
I want to move the data from one table to another formatted table.
In this case, every ID contains 6 values and can be classified as a, b type and 1,2,3 is their class, so you can see each class contain 2 values
image

Now I want to base on the above table and move it into this formatted table based on the class and type, I also need to show different combinations for the class (like 1 & 2, 2&3, 1&3)

For example, I want to display the first ID (1001) like that and also show counter 1 to say it is the first record.

It is too complicated for me. I have uploaded the seed file and the destination file for reference. Thanks for your help!!!

trialBias.xlsx (16.7 KB)

Destination.xlsx (13.6 KB)

Please can you provide the sample data

sorry I have uploaded the sample data file “trialBias” on it. Thank you!!!

One of many options:

dtData.AsEnumerable().SelectMany(Function (x) {({1,2}),({3,4}),({5,6})}.Select(Function (e) new Object(){x(e(0)), x(e(1))})).Select(Function (ra) dtResult.rows.Add(ra)).CopyToDataTable

So in a next step the prototype LINQ can be decomposed to essential Activities or to Query Syntax. For sure we can more adapt and dynamize

As the Extraction config is within above prototype incomplete we would also complete by all combinations

1 Like