Hi I am using Crystal 8.5 with an Oracle 10 database. I have a report which uses a formula based on the results of other formulas. I am trying to sort or order the report based on the results of the formula but I cannot see it in the TOP N/Sort Groups expert. I will try and explain what I have.
The formula I want to sort by is this:
@Availability:calculation of machine availabilityThis formula is placed in The group footer of each Workorder.eqnum group.
if {@Mean time between failure} <> 0 then
{@Mean time between failure}/ ({@Mean time between failure}+ {@Avg. Time to Repair} )*100
else 0
This calculation uses the following formulas:
@Mean time between failure :average amount of time between workordersThis is also placed in the group footer of workorder.eqnum
WhilePrintingRecords;
if {@sum workorders} <> 0 then
numbervar sumhrs /{@sum workorders}
else 0
@Avg. Time to Repair :mean time to repairThis is also placed in the group footer of workorder.eqnum
(By the way this field is the only choice I have in the TOpn/Sort Group expert)
Average ({@Repair Time}, {WORKORDER.EQNUM})
Both of these formulas are also in each detail line but the final calculation is done at the group level.
I will also include the other formulas:
@ Accumulative Hours-placed in details accumulated hours between repairs
WhilePrintingRecords;
numbervar hrs:={@Time between last failure};
numbervar sumhrs:= sumhrs +hrs;
@Repair Time:-placed in group footer repair time of record
if ({WORKORDER.ACTFINISH} - ({WORKORDER.ACTSTART}))* 24 < .05 then 0
else ({WORKORDER.ACTFINISH} - ({WORKORDER.ACTSTART}))* 24
@sum workorders: accumulated workorder which meet criteria Placed in group footer
WhilePrintingRecords;
numbervar countwo:=tonumber({@Count Workorders});
numbervar tothrs:= tothrs + countwo;
@Count Workorders :-placed in details and suppressed count of workorder which meet criteria
if {@Time between last failure} > 0
then 1
@Time between last failure :-placed in details and suppressed time between last workorder
IF previous({WORKORDER.WORKTYPE}) = 'EM'
and ({WORKORDER.ACTSTART} >= previous({WORKORDER.ACTFINISH}))then
((DateDiff ("n", previous({WORKORDER.ACTFINISH}),{WORKORDER.ACTSTART} ))/60)
I hope its not too cumbersome and if more information is needed, please let me know.
Thanks for taking the time to look.
The formula I want to sort by is this:
@Availability:calculation of machine availabilityThis formula is placed in The group footer of each Workorder.eqnum group.
if {@Mean time between failure} <> 0 then
{@Mean time between failure}/ ({@Mean time between failure}+ {@Avg. Time to Repair} )*100
else 0
This calculation uses the following formulas:
@Mean time between failure :average amount of time between workordersThis is also placed in the group footer of workorder.eqnum
WhilePrintingRecords;
if {@sum workorders} <> 0 then
numbervar sumhrs /{@sum workorders}
else 0
@Avg. Time to Repair :mean time to repairThis is also placed in the group footer of workorder.eqnum
(By the way this field is the only choice I have in the TOpn/Sort Group expert)
Average ({@Repair Time}, {WORKORDER.EQNUM})
Both of these formulas are also in each detail line but the final calculation is done at the group level.
I will also include the other formulas:
@ Accumulative Hours-placed in details accumulated hours between repairs
WhilePrintingRecords;
numbervar hrs:={@Time between last failure};
numbervar sumhrs:= sumhrs +hrs;
@Repair Time:-placed in group footer repair time of record
if ({WORKORDER.ACTFINISH} - ({WORKORDER.ACTSTART}))* 24 < .05 then 0
else ({WORKORDER.ACTFINISH} - ({WORKORDER.ACTSTART}))* 24
@sum workorders: accumulated workorder which meet criteria Placed in group footer
WhilePrintingRecords;
numbervar countwo:=tonumber({@Count Workorders});
numbervar tothrs:= tothrs + countwo;
@Count Workorders :-placed in details and suppressed count of workorder which meet criteria
if {@Time between last failure} > 0
then 1
@Time between last failure :-placed in details and suppressed time between last workorder
IF previous({WORKORDER.WORKTYPE}) = 'EM'
and ({WORKORDER.ACTSTART} >= previous({WORKORDER.ACTFINISH}))then
((DateDiff ("n", previous({WORKORDER.ACTFINISH}),{WORKORDER.ACTSTART} ))/60)
I hope its not too cumbersome and if more information is needed, please let me know.
Thanks for taking the time to look.