What is the better aggregationType for a DE with COC and Custom aggregation?

I am creating a DE with about 5 COCs. The DE is to calculate inventory. We will need to add and subtract one COC or the other.
Say for instance, the indicator may be calculated as:
(COC1 + COC2) - (COC4) / (COC3 + COC5).

For the DE is it better if I use NONE or CUSTOM as the aggregationType?

I am asking because after I created the metadata and generate data. I figure out that I the indicator is not appearing in the visualizer app. It says both that NONE and CUSTOM aggregationType cannot be used for disaggregation.

Does it mean I cannot use COC for the scenario above?

Thanks @jetisco4u! Could you please share the use case itself? It is usually very helpful in finding a solution? Thanks!

I wanted to use parts of a DE/COCs to compute a percentage indicator. But I was not getting any result when I did:

Numerator: (COC1 + COC2) - (COC4)
Denominator = (COC3 + COC5)
IndicatorType: %

So I go around it mathematically like
Numerator: (COC1 + COC2) - (COC4) / (COC3 + COC5) * 100
Denominator = 1
IndicatorType: 1

2 Likes

When using DHIS2 for inventory tracking, it is common practice to have a DE for a type of commodity, and COCs for various measures of the commodity. COCs can be used for such things as:

  • Stock level at the beginning of a period
  • Amount restocked during the period
  • Amount used during the period
  • Amount wasted/lost/expired/stolen during the period

If this is the kind of thing you’re trying to do, then you’re on the right track.

Note that if you capture the data at a lower level of organisation unit than the one you report at with an indicator, then the data will have to be aggregated. For example, are you trying to show the percentage of something at a district level where the data is collected at the facility level? Then the data element should have some kind of aggregation function, such as SUM.

If you could be more descriptive about what you want the indicator to show, I might be able to better advise you.

2 Likes

Initially I was using data element for all the measures of the commodity. But after switching to COC, and refactoring the indicator calculation as I explain above it is now working.

1 Like