My requirements are as follows:
I have a rebate structure as follows:
<product name=3D"blah">
<base rate=3D"1.05" />
<! 1.05=3D0.82+0.20+0.03 >
<! 0.71=3D1.05  ( 0.21+0.10+0.03=3D0.34) >
<rebate from=3D"0" to=3D"10000" value=3D"0.71" />
<rebate from=3D"10001" to=3D"20000" value=3D"0.76" />
<rebate from=3D"20001" to=3D"40000" value=3D"0.81" />
<rebate from=3D"40001" to=3D"80000" value=3D"0.86" />
<rebate from=3D"80001" to=3D"999999" value=3D"0.92" />
</product>
For each product I can get the total volume
using
select pname, sum(qty) QTY from sales group by pname
I have two fields PNAME and QTY.
In the report I have to display the total rebate.
for blah product if the QTY is 18000
then the rebate would
10000*0.71 + 8000 * 0.76 which comes from the above table.
The predefined operators count, sum, average, lowest, highest, variance
appear to be acting on the resultset.
if I could use MAX/MIN of any array of numbers then I could think of a way
MAX((SUM10000),0)*0.76+MIN(SUM,10000)*0.71
I would appreciate if you could help me with a JasperReport construct
to achieve this computation assuming SUM is a field retrieved from DataSour=
ce.
I would have to use if expression to decide which table to use or a subrepo=
rt
for each product.
thank you for your help

Raman
