Focal Point
Date-Field is summed - how to prevent?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5171078331

July 07, 2005, 02:47 PM
<Stahl>
Date-Field is summed - how to prevent?
We have fex like this:

DEFINE FILE CAR
DATEFIELD/YYMD WITH COUNTRY = 20040506;
END
TABLE FILE CAR
SUM DC AS ''
RC AS ''
BY CAR NOPRINT
BY DATEFIELD NOPRINT
ACROSS COUNTRY AS ''
COMPUTE DATEF1/D.M.YY = DATEFIELD;
WHERE COUNTRY IN ('ENGLAND','JAPAN')
ON TABLE COLUMN-TOTAL
ON TABLE SET PAGE-NUM OFF
END

In the result, the DATEF1-field is column-totalled to.

How can we prevent this?

Thanks for any advice!
July 07, 2005, 03:07 PM
k.lane
If you run the following:

DEFINE FILE CAR
DATEFIELD/YYMD WITH COUNTRY = 20040506;
DATEF1/D.M.YY = DATEFIELD ;
END
TABLE FILE CAR
SUM DC AS ''
RC AS ''
BY CAR NOPRINT
BY DATEFIELD NOPRINT
BY DATEF1
ACROSS COUNTRY AS ''
COMPUTE DATEF1/D.M.YY = DATEFIELD;
WHERE COUNTRY IN ('ENGLAND','JAPAN')
ON TABLE COLUMN-TOTAL
ON TABLE SET PAGE-NUM OFF
END

you will see that when sorting by DATEF1, the total line does not include the totalled DATEF1. The COMPUTEd DATEF1 will still be totalled. If you need to have the DATEF1 in the last column, you can use ON TABLE SUMMARIZE instead. That will reissue the COMPUTE on DATEF1 on the grandtotal line. The date will still display but will not be aggregated.

Of course, you can always use styling to make this column to be the same as the backcolor for the grandtotal line if you need to remove it....just one suggestion.

I'd be interested in seeing another way to do this.

Ken
July 07, 2005, 03:19 PM
Francis Mariani
I changed your column total to include
only the specific columns you want
totaled. Specifiying the columns you
want totaled is supposed to only total
the specified columns(!), but in this
case it is not behaving that way,
probably because of the ACROSS
and COMPUTE. If you change the
COLUMN-TOTAL
(or SUBTOTAL) to RECOMPUTE you
will still get a date but it won't
be totaled, it will probably be the
last one in the report.
DEFINE FILE CAR
DATEFIELD/YYMD W
ITH COUNTRY = 20040506;
END TABLE FILE CAR
SUM DC AS ''
RC AS ''<br />BY CAR NOPRINT
BY DATEFIELD NOPRINT
ACROSS COUNTRY AS ''COMPUTE 
DATEF 1/D.M.YY = DATEFIELD;
WHERE COUNTRY IN ('ENGLAND','JAPAN')
ON TABLE SUBTOTAL RC DC
ON TABLE SET PAGE-NUM OFF
END

This message has been edited. Last edited by: <Mabel>,