Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula Help

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
Using Crystal Reports 8.5 and Oracle tables, I need to create a Biweekly/Year to Date Report that would count three activities and look something like this:
Bi-Weekly Year-to-Date
Criminalistics
Cases Received
Cases Completed
Cases Pending
DNA
Cases Received
Cases Completed
Cases Pending
Drugs
Cases Received
Cases Completed
Cases Pending
Toxicology
Cases Received
Cases Completed
Cases Pending

Therefore I need to create formulas to count dates of cases received {ALL_ASSIGNMENT.Date Assigned}, cases completed {ALL_ASSIGNMENT.Date Completed} and any open assignment (cases) for each section {ALL_ASSIGNMENT.Section} for the two date ranges.

Pretty straight forward, except that I suck at CR Formulas.

Could someone give me instructions in setting up one or more of the needed formulas please???
 
I think I have found examples to point me in the right direction. I created variables and declared them in one formula, initialized them in another formula and will do the calculations in a third formula.

I am grouping on section. Where should I put my initialization so that each variable is set to zero as it calculates the group totals? In the Group footer and just supress the output??
 
You need to create a formula that defines your categories, unless they are simple field values. Whichever, group using those values. Suppress details and show just the totals, in a Group Footer with three sections.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Need to see what your sample data looks like to give you more helpful solutions.

On the surface, it looks like simple grouping with summary counts

Looks like your Group 1 is by Case Type (i.e. Criminal, DNA, Drugs, etc) with Group 2 by Case Status (Received, cCompleted and Pending.

Insert a summary on Case Status with a distinct count of Case number with subtotals at each group level.

Cheers,

-LW

 
I'm getting zeros from this formula......

if (IsNULL({ALL_ASSIGNMENTS.Date Completed})) then PendCnt := PendCnt + 1;

Any suggestions as to what I am doing wrong??
 
You'd be better off with running totals or summary totals, . Right-click on a field and choose Insert to get a choice. Or else use the Field Explorer, the icon that is a grid-like box.

Running totals allow you to do clever things with grouping and formulas. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.
Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
While my IsNull formula did not work, this does.....

if (totext({ALL_ASSIGNMENTS.Date Completed})) = "" then PendCnt := PendCnt + 1;

Go figure......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top