Mark56
December 9th, 2005, 02:09 PM
I have a new requirement I am have a problem with. On a yearly report I am suppose to take all the Unitprice's sold for a product and calculat the 25th Percentile:
PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description}), no problem
Then I need to calculate the loss on any of those orders that the Unitprice was less than 25thPercentile.
P_IncomeLoss=
If {ORLINH.Unitprice} < PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description})then
(PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description})-{ORLINH.Unitprice})*{@ConvertToLbs}
Else
0
And this all works fine in the Detail area of the report. The problem is that I cannot get a SUM of the P_IncomeLoss to see the loss for that product. I thought the RT and RTSet would be the answer but so far I cannot find a way that will give me sum's of P_IncomeLoss for each product.
Any help would b e greatly appericated, thank you.
Mark56
PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description}), no problem
Then I need to calculate the loss on any of those orders that the Unitprice was less than 25thPercentile.
P_IncomeLoss=
If {ORLINH.Unitprice} < PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description})then
(PthPercentile (25,{ORLINH.Unitprice},{ORLINH.Description})-{ORLINH.Unitprice})*{@ConvertToLbs}
Else
0
And this all works fine in the Detail area of the report. The problem is that I cannot get a SUM of the P_IncomeLoss to see the loss for that product. I thought the RT and RTSet would be the answer but so far I cannot find a way that will give me sum's of P_IncomeLoss for each product.
Any help would b e greatly appericated, thank you.
Mark56