Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sum of truncated values #314

Open
benedeki opened this issue Jan 29, 2025 · 0 comments
Open

Add support for sum of truncated values #314

benedeki opened this issue Jan 29, 2025 · 0 comments
Labels
Agent Issues touching the agent part of the project enhancement New feature or request

Comments

@benedeki
Copy link
Contributor

benedeki commented Jan 29, 2025

Background

Floating-point numbers no always have exact representation, so a rounding error can be introduced when summing up floating-point numbers.

In order to control accuracy and completeness of such numbers it makes sense to truncate the fractional part, summing up only the integral part of numbers, which have exact representation.

Feature

Add support for sum of truncated values.

P.S.
Update the documentation with new function.

Proposed solusion

Type Description
controlType.aggregatedTruncTotal Calculates SUM(TRUNC()) of the specified column
controlType.absAggregatedTruncTotal Calculates SUM(TRUNC(ABS())) of the specified column

SUM(TRUNC(x)) - Sum of truncated numbers of a column x.
SUM(TRUNC(ABS(x)) - Sum of truncated absolute values numbers of a column x.

Examples

  • trunc(123) = 123
  • trunc(123.0001) = 123
  • trunc(123.456) = 123
  • trunc(123.999) = 123
  • trunc(-123.456) = -123
  • trunc(-123.999) = -123

NB! Solution

This is a copy of recent Atum feature. Please copy the solution from there.
Issue: Atum/#156
PR: Atum/#157

@benedeki benedeki added the enhancement New feature or request label Jan 29, 2025
@benedeki benedeki added the Agent Issues touching the agent part of the project label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agent Issues touching the agent part of the project enhancement New feature or request
Projects
Status: 🆕 To groom
Development

No branches or pull requests

1 participant