Sample 1.xlsx (19.7 KB) Sample 2.xlsx (9.6 KB)

In this scenario, I want to get the total number of Regular Hours and the total number of OT Hours for a “Rest Day” Day Type in Sample 1 Excel file. Then, the total number of Regular Hours and the total number of OT Hours for a “Rest Day” Day Type will be pasted on its assigned cell in the Sample 2 Excel file. How can I do this? Thank you for the help.

Yoichi
(Yoichi)
January 11, 2020, 12:45pm
2
Hi,

Hope the following helps you.

Value property of each Assign activity are the following.

```
dt.AsEnumerable.Where(function(r) r("Day Type").ToString="Rest Day").Sum(function(r) CInt(r("Regular Hours")))
dt.AsEnumerable.Where(function(r) r("Day Type").ToString="Rest Day").Sum(function(r) CInt(r("OT hours")))
```

Regards,

2 Likes

Good Day. Thank you for the help. I will ask a question. How can I solve this? Thank you.

1 Like

Yoichi
(Yoichi)
January 15, 2020, 1:34am
4
Hi,

Sometimes, this error occurs for some reason.

The following will help you.

When trying to use the AsEnumerable() method on a data table, i receive a error stating that AsEnumerable is not a member of ‘System.Data.Datatable’. I’ve seen someone else with this problem and their solution was to use temporary data table activities in their project to load in the System.Data.DataSetExtension library. However this has not worked for me. Any help would be greatly appreciated.
Thank you.
Regards,

1 Like

Is there any other way to do it without using AsEnumerable() method?

Good Day. I have already discovered the solution for the “AsEnumerable is not a member of ‘System.Data.Datable’ ”.

dt.AsEnumerable().Where(function(r) r(“Day Type”).ToString=“Rest Day”).Sum(function(r) CInt(r(“Regular Hours”)))

We just have to put open and close parenthesis after AsEnumerable.

Thank you so much for the help and I’m sorry if I replied late to your help. Once again, thank you so much.

1 Like

system
(system)
Closed
January 18, 2020, 2:17am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.