Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [birt-dev] Additional aggregation functions
  • From: Claes Rosell <claes.rosell@xxxxxxxx>
  • Date: Fri, 12 Jan 2024 09:52:51 +0000
  • Accept-language: sv-SE, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=solme.se; dmarc=pass action=none header.from=solme.se; dkim=pass header.d=solme.se; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lYya1YVhxGTa/GLG1Mvo9k/Gc65vlGkrOHYZdTeLL/s=; b=IuaEEcLooBQXZuZsVjxEw4JBPXCCktHVrg1pj1l0DorSWYjWaWGAS+kRHronyGDGNB1Bub0UX23a80KSbOqPp3p4XN7awrw0bC703NHAZc0xUeNDl97zt6CJJy7WtNHftFCGs3/1WeC15Py5ie7sP4aP59p99JPLCd0yGVciuULJEirj5ds1MZT5QpawLkPK6klWHsi1Mi43KG309NIfdDKxMzRPX06CmWOX5/0ZjlDj7QQHSFDZ/v3IVzuuRt79UvsvK73aMUMzD318NUATfRMwYO6y93BUaFSkXCWglsWHSFvb05L5SVJW0V6FLfEsltgicTqN5BBJTM3jHEca7Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mxKOzm8jtocxfxORgyGdWsu6imii7LFtdcmiOdIo9yirxmZOCgb8bn8EeRv1imIQ9elaOVYm3SzXDqZhdd0pJyyLGfGlsViuGA1J/k1wdZBpc13y76cr+l5BuiDyQY4nPdxrRea0fk6hvCB/XOidDQXzlf9YZrFh7y7TYgEtRAbQBZnUwrg7g5luTNtwrunaCCkrSP7Jna0ygLbOv6Pvq9CE9rGEzGPo5EhbIwwbmpVQAQHjVg0GGJ0GT9w3wytqIcCc87CmC5n7vPvPMYEt2rVwcyW4HaA2GlRoIaYDszvpeLB6+7txcN/VB3a7VOj2AXfR+Hb5X3ZhP7s5L4pxrg==
  • Delivered-to: birt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/birt-dev/>
  • List-help: <mailto:birt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/birt-dev>, <mailto:birt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/birt-dev>, <mailto:birt-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHaROj8suE8Ovp1eEu/wgT95bHVBLDV54hF
  • Thread-topic: [birt-dev] Additional aggregation functions

Hi

I think these enhancements would benefit the BIRT project. 

We recently added a new aggregation function (https://github.com/eclipse-birt/birt/pull/1484), take a look at that implementation if you want inspiration for the implementation of these new aggregation functions.

Best regards
Clae Rosell

Från: birt-dev <birt-dev-bounces@xxxxxxxxxxx> för Yair Lenga via birt-dev <birt-dev@xxxxxxxxxxx>
Skickat: den 12 januari 2024 00:50
Till: birt-dev@xxxxxxxxxxx <birt-dev@xxxxxxxxxxx>
Kopia: Yair Lenga <yair.lenga@xxxxxxxxx>
Ämne: [birt-dev] Additional aggregation functions
 
Hi,

I am writing to get feedback on extending BIRT aggregation functions with few new functions: weighted average, weighted sum, compound sum. I am using birt to generate various risk reports, and i n found that those functions are essential for many templates. Having them as built-in, will simplify many templates, and will avoid the need to code them repeatedly.

Weighted-sum(v, w, threshold): calculate sum(w*v), ignoring any entry where w it v are null. The result is set to null:
* if any w is null
* if threshold is non-null, and the sum(w ) for entries with v=null / sum(w) > threshold.

The common usage will be to estimate total value of a portfolio, given set of holdings(w), and prices (v). The threshold logic make it possible to avoid showing result unless there is minimal data.

Weighted-average(v, w, threshold). Works the same, taking into account entries with non-null v. Entries with v = null will be excluded from the calculation. sum(v*w)/sum(w), fir all entries with v&w != null. Function return null if:
* any w is null
* sum(v*w) is null
* threshold not null, and sum(w) for v=null / sm(w) > threshold.
* sum(w) == 0

Compound-return(duration, return, threshold)  will calculate compound return base on period returns: product( (1+v) ^ duration ) for all entries with non null duration. Similar to the average/sum, result will be null if
* sum(duration) for non null v is 0
* all v are null
* threshold not null, and sum(duration) for non null v / sum(duration) > thread hold.

Average-return(duration, Return, threshold) - same as weighted average, calculate return per period compound-return(…) ^ (1/sum(duration) for return != 0)

Looking for a feedback.  Have enough knowledge to implement in Java.

Yair.


_______________________________________________
birt-dev mailing list
birt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/birt-dev

Back to the top