Get total hours worked by employee from Time card
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 12:52 AM
Hi all,
I want to calculate the total hours in a month by any user individually from Time card table.
Can some one help me in that.
Regards,
Avinash Balli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 01:04 AM
Hi Avinash,
You can get the total hours by month by adding a filter to only show the month then using list calculations by right clicking the header > configure > list calculations. This should then allow you to get the total value of all hours displayed at the bottom of the table.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 01:12 AM
var grTime = new GlideRecord('time_card');
grTime.addQuery('week_starts_onONThis month@javascript:gs.beginningOfThisMonth()@javascript:gs.endOfThisMonth()');
grTime.query();
var total = 0;
while(grTime.next()){
total = parseInt(grTime.monday) + parseInt(grTime.tuesday) + parseInt(grTime.wednesday)+parseInt(grTime.thursday)+parseInt(grTime.friday)+parseInt(grTime.saturday)+parseInt(grTime.sunday);
}
gs.addErrorMessage(total);
Regards,
Kishor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 02:10 AM
Thanks for the reply Kishore.
I want total hours in a month.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 10:28 AM
Hi Avinash,
Are you trying to get this in script, or through reporting?