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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating pending formula trying to ignore certain records in status

Status
Not open for further replies.

mouser4069

Technical User
Feb 28, 2007
11
0
0
US
We are trying to come up with a number of cases "pending" at the end of a month in our legal organization. We are using CR9. We use a complicated system of "statuses" which contains "Open, Re-Opened, Closed, Re-Closed, Collection, Request Date, Received, Transferred in, Transferred out, To FO, From FO (you get the picture).

We need to find out those records that are not in certain statuses as of the __EndDt. We want records that are not in Closed, Re-Closed, Collection, but want to IGNORE certain of the statuses rather than having the formula either include or not include these statuses.

We would like the formula(s) to IGNORE "The Division Assigned" or "Received" or "Request Date" and not include them in the check that CR is performing. Can this be done?

We also have selects and sorts, but here are our formulas:

Reduce formula:

whileprintingrecords;
If ({@Checkbreak} = False) then NumberVar x := x - 1;
If (({@checkbreak} = True) and
({XTABLE_StatusDesc.Description} = 'Request Date' or
{XTABLE_StatusDesc.Description} = 'Closed' or
{XTABLE_StatusDesc.Description} = 'Re-Closed' or
{XTABLE_StatusDesc.Description} = 'Collection' or
{XTABLE_StatusDesc.Description} = 'The Division Assigned' or
{XTABLE_StatusDesc.Description} = 'Received')) then
NumberVar x := x - 1;

Reduce grand formula:

whileprintingrecords;
If ({@Checkbreak} = False) then NumberVar tot := tot - 1;
If (({@checkbreak} = True) and
({XTABLE_StatusDesc.Description} = 'Request Date' or
{XTABLE_StatusDesc.Description} = 'Closed' or
{XTABLE_StatusDesc.Description} = 'Re-Closed' or
{XTABLE_StatusDesc.Description} = 'Collection' or
{XTABLE_StatusDesc.Description} = 'The Division Assigned' or
{XTABLE_StatusDesc.Description} = 'Received')) then
NumberVar tot := tot - 1;

Calc Formula:

WhilePrintingRecords;
Numbervar x;
If IsNull ({%CaseNameAndAGNo})
Then x:=x
Else Numbervar x := x + 1


Checkbreak Formula:

BooleanVar check;
If OnFirstRecord Then (
If {%CaseNameAndAGNo}<> Next({%CaseNameAndAGNo}) then
check = false
else
check = true)
 
I'd suggest breaking up the grand formula into a number of separate formula fields. The test could be 'boolians', no IF and returning True or False.

Put the formulas beside the raw data and tweak till it works how you're wanting it to work. Then put back together, but Crystal makes it easy for one formula to refer to another.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top