Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

add a summarized field without totaling by group...

Posted on 2003-12-09
7
Medium Priority
?
288 Views
Last Modified: 2012-05-04
This is probably a simple one...or not.

Using Crystal Reports 8.5, I'm running a query from an Informix database.  The query consists of
period
billing attorney
timekeeper
client number
invoice number
worked hours

and some others.  The result should be for each period there will be an invoice.  That invoice will have a dollar amount with multiple worked hour entries for each timekeeper.  I want the report to sum the worked hours by timekeeper-clientnumber-invoice-period.

If I run this query right out of Informix (dbaccess)  I can select distinct records and sum the worked hours in that fashion.  If I try this in Crystal, (summing worked hours), it will sum all worked hours for all timekeepers.

Basically if Joe had two time entries in January (5 hours and 2 hours) for client XYZ, I want the query to sum his hours (7 hours) and not include Nancy who had one time entrie of 2 hours for the same month and client.

Here is a copy of the query (not from Crystal)

SELECT DISTINCT
      period_yymm.p_yymm,
      matter.mbillaty,
      timecard.ttk,
      ledgfee.lfcode,
      timecard.tinvoice,
      ledgfee.lfamnt,
      timecard.tmatter,
      matter.mprac,
      matter.mdept,
      Sum(timecard.tworkhrs),
      timekeep.tkstdcst
FROM
      elite.ledger ledger,
      elite.ledgfee ledgfee,
      elite.matter matter,
      elite1.period_yymm period_yymm,
      elite.timecard timecard,
      elite.timekeep timekeep
WHERE
      timecard.tinvoice = ledger.linvoice AND
      timecard.tmatter = matter.mmatter AND
      timecard.ttk = timekeep.tkinit AND
      ledger.lindex = ledgfee.lindex AND
      period_yymm.pe = ledger.lperiod AND
      ((period_yymm.p_yymm>= pd_start And
      period_yymm.p_yymm <= pd_end) AND
      (ledger.llcode In ('PAY','PAY-LEG','WOFF')) AND
      (ledgfee.lfindex Not In (1776,1777,1778,1779,1780,1781)))
GROUP BY
      period_yymm.p_yymm,
      matter.mbillaty,
      timecard.ttk,
      ledgfee.lfcode,
      timecard.tinvoice,
      ledgfee.lfamnt,
      timecard.tmatter,
      matter.mprac,
      matter.mdept,
      timekeep.tkstdcst


Hopefully this makes sense to you.  Thank you.
0
Comment
Question by:AConover
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 9906366
In Crystal you can use RUNNING TOTALS to do what you want.

In the report group the data as you want it, then create the running totals

Open the FIELD SELECTOR
Select RUNNING TOTAL
Right click --> Select NEW
Give it a name
Select the field - timecard.tworkhrs
Type  - SUM
Reset - On Group Change
Evaluate - For each record

Put the running total in the group footer

You can eliminate the groups and the sum field in the query, the raw data is passed in.
Add groups in Crystal

mlmcc
0
 
LVL 1

Author Comment

by:AConover
ID: 9906441
Wow, wasn't aware of that feature.  
Ok, I don't have any groups set up, just raw detail.
0
 
LVL 1

Author Comment

by:AConover
ID: 9906626
Here's an example of the returned data.  These are all raw time entries.  TWorkhrs is summarized by timekeeper.  The 2.6 hours for FLB (ttk) is actually 3 separate entries totaling 2.6.  

p_yymm      mbillaty      ttk      lfcode      tinvoice      lfamnt      tmatter                   mprac       mdept  sum of tworkhrs
0301      FLB      FLB      PAY      23482      867.5      AE100-00122      550      20      2.6
0301      FLB      JWS      PAY      23482      867.5      AE100-00122      550      20      0.5
0301      FLB      LRM      PAY      23482      867.5      AE100-00122      550      20      0.2
0301      FLB      FLB      PAY      23483      825      AE100-02385      540      20      3
0
 
LVL 1

Author Comment

by:AConover
ID: 9907077
I'm not sure how to group the data, since I need all the raw data returned.  Any ideas?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 400 total points
ID: 9917479
Open the report
Click INSERT --> INSERT GROUP
Select the field you want as the master group
   I think you want  -  timekeeper
Repeat for the other groups
       clientnumber
       invoice-period

mlmcc
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question