dtの("TimeSpan")平均値を計算して、他のdtに出力したい

@gorby

First build a datatable with teo columns and both of string type and it is dt4

Dt4 = Dt3.AsEnumerable.GroupBy(function(x) x(0).ToString).Select(function(x) dt4.LoadDataRow({x.Key,If(x.Where(function(y) y(4).ToString.Equals("0")).Count>0, Timespan.FromSeconds(x.Where(function(y) y(4).ToString.Equals("0")).Average(function(y) Timespan.Parse(y(3).TOstring).ToTalSeconds)),"00:00:00")},False)).CopyToDataTable

Cheers

1 Like