Focal Point
Cleared sum value

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

September 01, 2006, 10:23 AM
gregson06
Cleared sum value
Does anyone know how to remove the value '.00' from reports where one does a sum by date? For example:

TABLE FILE CAR
SUM
PRICE
BY BUY_DATE
END

The thing is that my values include negatives so one date can have a cancelled out string of transactions so it would appear like so:

CAMARO
9/13/2006 30000.00
9/14/2006 .00
9/16/2006 2099.00

But I don't want to show values that have that cancelled out '.00'. I've tried doing a WHERE PRICE NE 0 but it doesn't remove them. Any thoughts?
September 01, 2006, 10:27 AM
Tony A
Yes, use inline reformatting -

TABLE FILE CAR
SUM
PRICE/D8
BY BUY_DATE
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 01, 2006, 10:36 AM
Tony A
... or if I take the time to read your last sentance Red Face.

I take it that a negative summation would still be required to be shown?

You could try converting to an integer and then back again to rid yourself of the spurious decimal places -
DEFINE FILE GGSALES
 MYDOLLARS/D12.2 = (INT(DOLLARS * 100)/100);
END
TABLE FILE GGSALES
SUM MYDOLLARS
DOLLARS
BY PRODUCT
WHERE MYDOLLARS NE 0
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 01, 2006, 11:45 AM
ET
I would change the request to be :

TABLE FILE CAR
SUM
PRICE
BY BUY_DATE
WHERE TOTAL PRICE NE 0;
END

The TOTAL is key here as FOCUS would be eliminate the by field total of price if the subtotal is zero.

Good LUck

ET


FOCUS 7.6 MVS PDF,HTML,EXCEL
September 13, 2006, 11:12 AM
gregson06
This issue has been resolved and is similar to what Tony A suggested, in fact I'm pretty sure that solution will work. What I ended up doing was creating an integer of the same size and multiplying the old result by 100, the true zeros would stick out like sore thumbs:

DEFINE FILE CAR
VALUE/D12.2 = VALUE1 - VALUE2;
SVALUE/I14 = VALUE*100;
END

TABLE FILE CAR
VALUE1
VALUE2
VALUE
SVALUE
WHERE SVALUE EQ 0
END

That second to the last statement could be changed to 'NE 0' just to prove to thyself that the zeroes really are not going to be (or will be) picked up.

Thanks!
September 15, 2006, 10:06 AM
gregson06
quote:
(INT(DOLLARS * 100)/100)



Tony A's solution to this quandry is actually the victor. I ran my version of the report and kept getting errors in the calculation because WebFOCUS would not recognize my zero as an actual zero (go figure). But when I included the INT function and the divide by zero, it worked. Please use the other solution instead.

Thanks all!
September 15, 2006, 04:12 PM
ptp
Possibly simpler to try:

TABLE FILE CAR
SUM
PRICE
BY BUY_DATE
WHERE PRICE NE MISSING
END

P
September 15, 2006, 10:59 PM
susannah
or take T's suggestion and format price as PRICE/D8S
and the S will suppress the display of zeros, but you'll still have show a record for the date; if you don't want the record at all, i like ET's suggestion




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID