Data Elements with Aggregate type cannot be re-used?

It seems Data Elements with Aggregate Type (for Datasets) cannot be reused? Is my understanding correct? If so isn’t a design which needs to be improved?

Scenario: I create a data element Age for one dataset A, If I want to re-use the same Age in dataset B, (technically we can) but it will still show the values we entered through dataset A.? Is this a problem only for me?

1 Like

Probably someone can explain this better, but check this: DHIS2 User Manual - DHIS2 Documentation

To my understanding you should not see Data Element as a box where you store data, but as a reference to the box where you will store the data. That reference is not a single reference, but crossed with others (as explained in the link: OU, Category, Period etc). To simplify the explaination let’s assume we have D (from DataElement), O (from OrgUnit), C (from Category), T (from time).

No matter how you use those references, the moment you use D x C x O x T as a reference (in any order) the DataValue you stored should appear. Which is the correct behavior.

So, yes, you can reuse the DataElement and it is what is expected from a design point of view.


Yes I see, but where do they require such a use case, also it’s not the same way for events right

But i understand this behaviour now, so for datasets we cannot necessarily re-use data elements if it doesnt meet this criteria, but for events we can.

In some national implementations, the same (aggregate domain) Data Element, such as ‘Malaria cases’ is assigned to different datasets because different types of facilities may use different reporting forms (represented in DHIS2 as “data sets”). For example, a Health Center might only report on a subset of data elements compared to a District Hospital so they have different data sets assigned. However, both types of facilities report on ‘Malaria cases’ and therefore the values for that data element are expected to aggregate regardless of data set assignment. This works fine because the same OU does not have the same DE in multiple datasets for the same period.

If a given Org Unit were reporting on a DE ‘Malaria cases’ in two data sets, for the same period, for the same org unit – those would also aggregate, and depending on design could be construed as “double reporting”. So you need to think carefully about reusing agg DEs in different datasets. Hope that gives a bit of an illustrative example to Jaime’s math.

As you note, re-using data elements for an event or tracker program does not follow the same behavior. That’s because the analytics are rendered at the Program level. In our packages, we often re-use common (tracker domain) data elements such as ‘Pregnancy status’ or ‘Date of Death’ across programs.


Thanks, Rebecca, it gives me more clarity on this behaviour.

1 Like