Focal Point
[SOLVED] Division of record count

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

August 07, 2014, 06:40 PM
AmiSol
[SOLVED] Division of record count
I'm trying to create the following compute:

(( CNT.IsCertified + CNT.NOT_CERTIFIED) / ( CNT.ROSTERID - CNT.IsReleased)) * 100

Even though the counts of the fields are greater than 0, I always get a 0 back. I think it has something to do with the field type, but not sure how to fix it. Tried changing the IsCertified, NOT_CERTIFIED, IsReleased to Decimal, but it didn't help.

Thanks

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


WebFOCUS 8.0.7
Windows, All Outputs
August 08, 2014, 12:46 AM
jvb
Hi AmiSol,
check if following code helps, else if you could provide some sample code using car file

TABLE FILE CAR
SUM
COMPUTE PCT/D10.2%=(CNT.CAR +CNT.COUNTRY) / (CNT.MODEL-CNT.CAR) * 100;
BY COUNTRY
END


WF 8.1.04,Infoassist,Oracle, Excel, PDF,HTML.
August 10, 2014, 02:40 PM
Danny-SRL
Ami,

What is the format of your result field?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 11, 2014, 11:22 AM
susannah
CNT. is going to give you I5.
look at each variable's content separately, and you'll be able to figure out why the formula is giving you an undesired results. do the basic research.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 11, 2014, 11:30 AM
AmiSol
susannah-I'm new to WebFocus - is there a way to convert the data type of a formula from I5 to decimal from the expression editor pane?


WebFOCUS 8.0.7
Windows, All Outputs
August 11, 2014, 03:23 PM
susannah
i have no idea what an expression editor pane is, but sure. easy. just a define, as in jvb's example. but first you have to do your research, what do these 4 fields actually contain? print out each of them and just look.
CNT.IsCertified
CNT.NOT_CERTIFIED
CNT.ROSTERID
CNT.IsReleased




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 11, 2014, 06:49 PM
AmiSol
ok, I figured it out - I had to remove the cnt. from the fields as they were define fields and the aggregation takes place on the report (sum).


WebFOCUS 8.0.7
Windows, All Outputs