July 17, 2007, 02:56 PM
Madhucalculating percentage
Hi All,
I need your help on this. I tried my best but couldn't figure it out.
In the .mas file I am trying to do this
DEFINE DAYS30/D6.2% = (TOTAL / (TOTAL + M_ONE)) * 100;, TITLE = 'DAYS30',$
Total and M_ONE are database fields and the datatype is float.
The problem here is I am not getting correct result. For EX TOTAL has 11326 and M_ONE has 1350 and I should get 89% but I am getting 801%
Thanks for any help
July 17, 2007, 03:20 PM
LeahWonder if you are being bit by not having the field define large enough decimals, to handle the decimals prior to the multiplication? or do you need to multiply by 100 since the descriptor is assuming a percentage?
July 17, 2007, 03:25 PM
MadhuI did try with D20.2 and without % as well.
I am having the same problem
July 17, 2007, 03:52 PM
mgrackinMadhu,
Does your request do a PRINT or a SUM? You may be aggregating multiple records if you are getting 801%. It is impossible to get over 100% with the calculation you have.
July 17, 2007, 04:25 PM
MadhuThanks Mickey for pointing me in right direction
Let me work on this Little more,I think I Know what the problem is. Will get back soon.
July 22, 2007, 10:32 AM
FrankDutchMadhu
Are the two fields in the same segment of the database?
Did you try to use this defined field in a define instead of in the master?
Is the result then also wrong?
August 13, 2007, 04:28 PM
MadhuHi Frank,
Sorry I did not notice your post. As Mickey pointed out, It was aggregating. That problem is solved.
Thank you