September 01, 2006, 10:23 AM
gregson06Cleared 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 AYes, use inline reformatting -
TABLE FILE CAR
SUM
PRICE/D8
BY BUY_DATE
END
T
September 01, 2006, 10:36 AM
Tony A... or if I take the time to read your last sentance
.
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
September 01, 2006, 11:45 AM
ETI 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
September 13, 2006, 11:12 AM
gregson06This 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
gregson06quote:
(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
ptpPossibly simpler to try:
TABLE FILE CAR
SUM
PRICE
BY BUY_DATE
WHERE PRICE NE MISSING
END
P
September 15, 2006, 10:59 PM
susannahor 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