OK, fine.
But do consider Edson's hint.
Also, you should be *very* careful with expressions such as $value / 4
/ 7 * 365 / 12. Truncation due to integer division may create highly
inaccurate results, especially when several inaccurate values will be
summed. (Also, use the formula only in the final comparison.)
-W
On 7/15/09, Richard Sherman <rsherman315(a)hotmail.com> wrote:
Thanks very much Wolfgang it was seeing the "2P" in your equation that made
me realise that I had missed the "amountInPence < 0 &&" in the
final
accumulation. Its now working fine.
Richard
Wolfgang Laun-2 wrote:
>
> For simplicity's sake, I'll only consider the first example, where all
> transactions with amount < 0 are also Type 1.
>
> Let P be the sum of the positive values and N (<0) the sum of the
> negative values over all transactions. Then
> $charges = P
> $adjustment = 29/336*N
> intValue = -P - N
>
> The last CE would be true if
> -P - N > P + 29/336*N
> 2P < -N(1+29/336)
>
> Since P > |N| (in the first example), clearly this cannot be true.
>
> -W
>
>
>>> >>>
>>> >>> Number( intValue > ($charges + $adjustment)) from
>>> >>> accumulate(
>>> >>> (RentTransaction
>>> >>> (transactionDate > oneMonthAgo
>>> >>> $value : amountInPence)
>>> >>> from $acc.transactions),
>>> >>> sum($value)
>>> >>> )
>>> >>>
>
>
--
View this message in context:
http://www.nabble.com/Comparing-multiple-accumulations-tp24476495p2449335...
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users