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

Null values

Status
Not open for further replies.

ShortyA

MIS
Feb 20, 2002
363
CH
Hi,
I have a formula as below and am averaging the result in a crosstab. However, if the {requesttype} does not startwith 'A -' then the result is 0 when I want it to be null (if it is 0 then this drags the average figure down).

Does anyone have any advice on this ?

Regards - Shorty
Code:
if {ThirtyDaysTotal.requesttype} startswith 'A -'
then
(if isnull({ThirtyDaysTotal.TotalConnectTime})
    then {ThirtyDaysTotal.TotalConnectTime}
else 
({ThirtyDaysTotal.TotalConnectTime}/{ThirtyDaysTotal.NumConnections})/1000
)
//need an else here to cover others
 
In Crystal 8.5, you can get averages using running totals. And these can use formula rules, e.g. not including values of A.

Madawc Williams
East Anglia, Great Britain
 
Why not eliminate those starting with "A-" from the crosstab? Highlight {request_type} and choose "Group Options"->specified order->new->"does not start with"->enter "A-"->add->OK and then choose the "Others" tab and select "Discard all others".

-LB
 
I did think about being selective on the crosstab but the totalconnecttime can contain either the elapsed or response time and I need to average these separately.

I think that the data is going to be split at the database level instead rather than trying to bend Crystal around the database too much. Thanks for the suggestions though!
ShortyA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top