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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

division

Status
Not open for further replies.

kfr104

Programmer
Mar 3, 2008
12
US
I am using the define function and when I am doing the division function I am getting number that are not correct...

I am dividing two P12 formats and trying to get a percentage...and it is not working out.

What am I doing wrong?

Thanks,
Kerry
 
I used compute instead of Define and it worked. However, I have a column that I am doing CNT.DST and I want to use that number and divide it into sales but it does not work. What do I have to do to the formula to make it work?

Thanks,
 
If it works with COMPUTE, and not DEFINE, that means you want the division to be done on the AGGREGATED values, not on the details. You can use PCT.CNT.field in a calculation, exactly as you used the verb objects. Here's an example:
Code:
TABLE FILE CAR
WRITE RCOST DCOST CNT.DST.BODYTYPE
COMPUTE RATIO=100*RCOST/DCOST * CNT.DST.BODYTYPE;
BY COUNTRY
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top