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

fix: use correct aggregation type if numberType undefined (DHIS2-15698) #1564

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

edoardo
Copy link
Member

@edoardo edoardo commented Aug 15, 2023

Implements DHIS2-15698


Key features

  1. fix subtotals/totals in PT

Description

The issue is a check in the PT engine on numberType.
Old saved AO do not necessarily have numberType returned if the value matches the default.
Because of that check in the PT engine, in that case a total aggregation type override variable is set to be SUM and that is what causes the subtotals/totals to be the sum of the column/row values.
Once Update is clicked, the app takes all the options from the Options modal and use those to control the table output.
At this point, numberType is set to VALUE (which is also the default) and the override for the aggregation type is not set, AVERAGE is then used and the subtotals/totals are correct.

The fix is about not overriding the aggregation type variable when no numberType is present, which is equivalent to have numberType set to its default value of VALUE.


Screenshots

numberType option in DV:
Screenshot 2023-08-15 at 12 35 38

Before the fix, loading an AO does not respect the total aggregation type:
Screenshot 2023-08-15 at 10 40 04

After the fix, loading the AO uses the correct aggregation type:
Screenshot 2023-08-15 at 10 39 45

numberType can be missing in AO that use the default value for it.
The default value is VALUE and should not cause the total aggregation
type to be overridden.
@edoardo edoardo merged commit c740e32 into master Aug 28, 2023
2 checks passed
@edoardo edoardo deleted the fix/total-aggregation-type-DHIS2-15698 branch August 28, 2023 12:09
dhis2-bot added a commit that referenced this pull request Aug 28, 2023
## [26.0.17](v26.0.16...v26.0.17) (2023-08-28)

### Bug Fixes

* use correct aggregation type if numberType undefined DHIS2-15698 ([#1564](#1564)) ([c740e32](c740e32))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 26.0.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

@janhenrikoverland janhenrikoverland changed the title fix: use correct aggregation type if numberType undefined DHIS2-15698 fix: use correct aggregation type if numberType undefined (DHIS2-15698) Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants