Solved

add a summarized field without totaling by group...

Posted on 2003-12-09
7
284 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
  • 3
  • 2
7 Comments
 
LVL 100

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 100

Accepted Solution

by:
mlmcc earned 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Crystal Reports 15 94
business objects to connect to MSSQL 6 84
Crystal Reports Help Memory Variable Not Totalling Cumulatively 2 19
Sum Before Standard Deviation 2 20
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

837 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