Need to sum values in the column and separate into multiple columns

Hello everyone,

Book1.xlsx (9.3 KB)

I have attached the input file. I need output in this format. Can anyone help me solve this…


Hi @poojadass.murugadass ,

Use PIvot table activity or use Macro to create a output like above.



How about the following?

dtResult = dt.AsEnumerable.GroupBy(Function(r) r("Employee ID").ToString).Select(Function(g) dtResult.LoadDataRow({g.key}.Concat(arrCol.Select(Function(c)  g.Where(Function(r) r("Leave Type").ToString=c).Sum(Function(r) Double.Parse(r("Days/Hours Taken").ToString)).ToString)).ToArray,False)).CopyToDataTable() (9.9 KB)


Have tried, couldn’t get output as above.

Thank you, Yoichi. I’ll try and let you know.

Thank You @Yoichi, It’s working.

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