Computing then Copy and paste of total Regular Hours and total OT Hours of "Rest Day" Day Type

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.

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

Hi,

Sometimes, this error occurs for some reason.

The following will help you.

Regards,

1 Like

How will I do that?

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(“Day Type”).ToString=“Rest Day”).Sum(function® 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

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