I have a list of Excel data and I want to run a query on it. I want epplus to identify replicated data in the first column and sum the values in the second column in replicate field. if this was my data:
Name Value
Ali 12
Hasan 4
Hasan 3
Ali 3
I want to do this with epplus:
Name Value
Ali 15
Hasan 7
I found Select multiple fields group by and sum but it doesn't do that with epplus. Can anyone help me?this is my code in epplus.
string fileman = Path.Combine(Path.GetTempPath(), "MyExceldata.xlsx");
using (ExcelPackage package = new ExcelPackage(new FileInfo(fileman)))
{
ExcelWorksheet sheet = package.Workbook.Worksheets["Data"];
for (int i = 1; i <= sheet.Dimension.Rows, i++)
{
//column of name //--running my query in epplus
sheet.Cells[i,1].Value
//column of value //--running my query in epplus
sheet.Cells[i, 2].Value
}
//--running my query in epplus
package.Save();
}