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…

image

Hi @poojadass.murugadass ,

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

Regards,
Arivu

HI,

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()

Sample20221125-a1v2.zip (9.9 KB)

Regards,

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.