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!

Help with Summarizing a field that says it can not be summarized 1

Status
Not open for further replies.

torolimon

Technical User
Oct 30, 2008
20
0
0
US
This is really convoluted:

The field I'm trying to summarize is {@elapsed Time in OR} = tonumber(DateDiff("n",{@Reported In OR Time},{@Reported Out OR Time})) .

{@Reported In OR Time} = if isnull(maximum({@Recorded In OR Time}, {OR_LOG.LOG_ID}))
then {@x null datetime} //i.e. don't display anything
else ((maximum({@Recorded In OR Time},{OR_LOG.LOG_ID})))

{@Reported Out OR Time} = if isnull(maximum({@Recorded Out OR Time}, {OR_LOG.LOG_ID}))
then {@x null datetime} //i.e. don't display anything
else ((maximum({@Recorded Out OR Time},{OR_LOG.LOG_ID})))

{@Recorded In OR Time} = if ({OR_LOG_CASE_TIMES.TRACKING_EVENT_C} in [60]) then
if not isnull({OR_LOG_CASE_TIMES.TRACKING_TIME_IN}) then
{OR_LOG_CASE_TIMES.TRACKING_TIME_IN}
else {@x null datetime}
else {@x null datetime}

{@Recorded Out OR Time} = if ({OR_LOG_CASE_TIMES.TRACKING_EVENT_C} in [110]) then
if not isnull({OR_LOG_CASE_TIMES.TRACKING_TIME_IN}) then
{OR_LOG_CASE_TIMES.TRACKING_TIME_IN}
else {@x null datetime}
else {@x null datetime}
 
Are the values you are getting for {@elapsed Time in OR} correct? If so, you can use variables to summarize these values. Please explain what the summary is that you want to do and at what level--group and/or report level.

-LB
 
Yes the values are correct. I have the {@elapsed Time in OR} in the Details section. I'm wanting to put the total in the Group 1 footer or Header.
 
This only works if the result can be in the footer. Create three formulas:

//{@reset} to be placed in the group header and suppressed:
whileprintingrecords;
numbervar tot;
if not inrepeatedgroupheader then
tot := 0;

//{@accum} to be placed in the detail section and suppressed:
whileprintingrecords;
numbervar tot := tot + {@elapsed Time in OR};

//{@display} to be placed in the group footer:
whileprintingrecords;
numbervar tot;

I'm surprised you are saying the elapsed time is in the detail section, since you are referencing summaries.

-LB
 
I did what you recommended and it is counting all the values (including the values that I have suppressed due to duplicates). I'm trying to find a way to only summarize the values that I actually have showing on the report.
 
Suppressed amounts are always included in summaries unless you explicitly remove them. What is your suppression formula?

-LB
 
The only thing I'm doing to suppress values is to check "suppress if duplicate".

Here is an example of what I'm trying to do:
Time In Or Time Out OR
Record #1 null 6/01/09 13:30
6/01/09 13:00 null
null null

This happens for each record but about 20-30 per record and I'm pulling 4 times into this report. A coworker showed me how to do the recorded/reported formulas to pull the value I want into the group field. I'm then getting a datediff on the values I'm reporting and then trying to sum that value.
 
You should have an inner group (group#2) on Log_ID and then place the {@accum} formula there. The reset and display formulas belong in the GH#1 header and footer, respectively.

-LB
 
It worked. Thank you so much. That is really awesome. Three of us have been trying to figure this out for 3 days. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top