Solved

add a summarized field without totaling by group...

Posted on 2003-12-09
7
279 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now