Jump to content
  • 0

Totals For Subgroups On Bottom Of Report


ababcock

Question

I have created a search and report page to display time sheets for employees. We have different "types" of time: regular, holiday, sick, vacation, personal, and bereavement. The employee selects this from a drop down when submitting time sheets.

 

When running the report, I would like the data to be sorted by date, to keep it as easy to read as possible. However, at the bottom of the report, I would like a total of all the hours as well as totals for any types indicated (i.e. Sick Total 4 hours, Vacation Total 8 hours, Regular Total 28 hours, Total 40 hours). I can get totals for subgroups and overall, but that automatically sorts the data by the subgroup (Type), so the data is sorted by Type before Date. I'm including a screen shot for reference. Can you tell me how to get all the totals to appear at the bottom, so I can sort by Date? Thanks!

 

post-18151-0-69997200-1440041909_thumb.p

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Yes, this can be achieved. Remove your current aggregate fields and set tabular report to sort by date. Then add 5 aggregate fields (1 for total hours and 4 for your individual types totals):

 

Add Aggregate field

Name Aggregate "Total Hours" or Total Holiday Hours, Total Sick Hours, etc

Select Hours field

Select formula, add the formulas below

Uncheck "Also Apply to First Group"

 

Formula for total hours:

 

select sum(Hours) from TABLENAME

 

Formula for total hours by type:

 

select sum(Hours) from TABLENAME where Type='Holiday'
 

Keep in mind these formulas are calculating directly from your table or view listed (TABLENAME) so if the report has filters or search parameters you will need to include in the formulas above so the tabular data matches the aggregate totals. if you referencing database is a view and not a table, insert _v_ before the name (example: view called "TEST" should be referred as "_v_Test" in formulas above.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...