lovepong66
(Rugpong Sirimart (Luck))
November 14, 2022, 12:52pm
1
I have an example data like this i would like to grouping it and generate into a new excel file
how can i do that?
see image at below
as you see at image i grouping by two columns (code column and location column) i don’t care data in item column.
thank you for helping me. So thank you very much if someone do example for me.
Gokul001
(Gokul Balaji)
November 14, 2022, 1:04pm
2
Hi @lovepong66
How about this expression
(From d In DtBuild.AsEnumerable
Group d By k=d("code").toString.Trim Into grp = Group
Let ra = New Object(){k,grp.First()(1),grp.First()(2)}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable
Check out the XAML file
GroupGeneratedExcelfiles.xaml (12.5 KB)
Note : Kindly update the Column Names
Regards
Gokul
2 Likes
Yoichi
(Yoichi)
November 14, 2022, 1:06pm
3
Hi,
How about using Dictionary as the following?
dict = dt.AsEnumerable.GroupBy(Function(r) Tuple.Create(r("code").ToString,r("location").ToString)).ToDictionary(Function(g) g.Key,Function(g) g.CopyToDataTable())
Sample20221114-2aL.zip (3.1 KB)
Regards,
1 Like
Hi @lovepong66 you can also do it by filter data table activity, here I am doing for one category. You can do it for others
lovepong66
(Rugpong Sirimart (Luck))
November 14, 2022, 1:41pm
5
You’re great!!! that what i need
1 Like
lovepong66
(Rugpong Sirimart (Luck))
November 14, 2022, 1:46pm
6
thank you for your reply it a good idea to do with this. Thank you very much
1 Like
system
(system)
Closed
November 17, 2022, 1:47pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.