-
Notifications
You must be signed in to change notification settings - Fork 0
Decimal Weighted Ave
Steve Schafer edited this page Mar 18, 2024
·
1 revision
Use in place of the built-in WEIGHTEDAVE aggregation to avoid tiny errors that can be introduced by floating point math.
This aggregator calculates the result by using the BigDecimal add, multiply and divide methods. It changes the column binding data type to DECIMAL, although you can change it to something else after.
An additional parameter is Weight, which is an expression that returns a decimal value. You should use new BigDecimal() for constant values or use BirtMath if you wish to perform calculations on the current data row. This value is ignored for all rows except the first.
- Aggregate Functions
- Decimal Average
- Decimal First
- Decimal Last
- Decimal Max
- Decimal Median
- Decimal Min
- Decimal Mode
- Decimal Moving Ave
- Decimal NPV
- Decimal Percentile
- Decimal Percent Sum
- Decimal Quartile
- Decimal Range
- Decimal Running NPV
- Decimal Running Sum
- Decimal StdDev
- Decimal Sum
- Decimal Variance
- Decimal Weighted Ave