Data Group and Filter Problem

Here is my excel file.

sample.xlsx (21.4 KB)

Here are the colors of automobiles :point_down:

How to grouping the cars on the “Otomobil” page according to their Color values and drawing the value of how many they are in a “Color Quantity Page” ???

Note : Needs to do it with linq methods

Hi,

Can you also share expected output?

Regards,

Same colors will be following each other.

Hi,

How about the following sample?

Sample20230718-1aL.zip (21.0 KB)

Regards,

2 Likes

It seems fine but mentor wants me to do it with linq methods

Can you try the following expression?

dt = dt.AsEnumerable.OrderBy(Function(r) r("Renk").ToString).CopyToDataTable

Regards,

1 Like

I ll let you know when i am able to try it

please find the attched result file.
sample.xlsx (20.9 KB)

for linq you can use following query,

Dt2=Dt.AsEnumerable().OrderBy(Function (row) row(“Renk”).ToString).Select(Function (row) row).ToArray.CopyToDatatable()

1 Like

Yes it works but i also want to count how many different colours and total numbers of colours like in the following.

image

Hi,

How about the following sample? This outputs count sheet in Sheet2.

dtCount =dt.AsEnumerable.GroupBy(Function(r) r("Renk").ToString).Select(Function(g) dtCount.LoadDataRow({g.Key,g.Count},False)).CopyToDataTable()

Sample20230718-1aLv2.zip (22.5 KB)

Regards,

Also it has to be string, right ?

Hi,

Does the above sample work? Did you modify the workflow?
For now, can you check dtResultsPage and/or dtRenkAdet is null or not at Locals panel when error occurs?

Regards,

My bad!

Output of Build Data Table was empty :robot:

Thanks for the solution :+1:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.