Data Entry Form Does Not Support Indicators Created Using Indicators

Hello Community,
Creating indicators using other indicators has proven to be a quite useful tool for us in our DHIS2 implementation. Our use case for this has mostly been for analytics.

We have tried to see if this type of indicator can work on custom data entry forms. What we noticed is that if you place an indicator created using indicators on a custom form, every other indicator placed after that indicator stops calculating.

Is this something you could kindly take a look at?

Thank you.

Hello @ifeanyiokoye,

Thank you for your post! As you know the DHIS2 Community of Practice is supported by the community and backed by the DHIS2 core team experts so I’m sorry I edited your post to “Hello Community” instead of “support team” we’re all here community members supporting each other. :wink: Please check out #copmonthly (I hope you’ll enjoy!)

As for your question, are you able to reproduce this on play.dhis2.org? What is the version of the DHIS2 instance that you are using? Please could you also share the expression used in the combined indicator? I think you are facing a bug which we can report on jira.dhis2.org if we can reproduce it on any instance but if we can’t reproduce it then maybe we’re configuring something wrong. :+1::+1::+1:

Thank you!

1 Like

Thank you @Gassim for the corrections and insights.
Apologies also for missing out on vital information in my post.

We are running DHIS2 version 2.36.8.

The error is reproducible on the demo instance of 2.36.8

See a custom dataset I just created to show this:

The first indicator “Total ANC Visits” is a combination of indicators “Total visits 1&2” and “Total visits 3&4” and this is the indicator expression: N{PUghJGuGmyS} + N{rRnszMfbTnn} which shows as 1-2 ANC visits + 3-4 ANC visits
This is the error in the browser console:
image

But once, I take out that indicator from the form, all the other indicators start to work:

Let me know what you think.

Thanks

Ifeanyi

1 Like

Hi @ifeanyiokoye,
Thank you so much for clarifying!

My suggestion is to create the Total ANC Visit like this:
#{ANC Visit 1 Fixed} + #{ANC Visit 1 Outreach} + #{ANC Visit 2 Fixed} + #{ANC Visit 2 Outreach} + #{ANC Visit 3 Fixed} + #{ANC Visit 3 Outreach} + #{ANC Visit 4 Fixed} + #{ANC Visit 4 Outreach}

It should give you the result, right? If it solves the issue please mark this post as solution :grin: Thanks!



As for this expression I wish to know what selection you made here:

@Gassim This was a simple example I used to demonstrate the issue. We have indicators built with multiple data elements that it would be so time-consuming to do this one by one. So, for our analytics, when we have similar data elements used for different indicators, we can combine indicators to form a new indicator and that saves a lot of time in configuration. Unfortunately, this does not seem to work on the forms but works with the analytics.

As regards the formula, you need to look at this thread some years ago Indicators Used to Make Indicators and the corresponding JIRA post as well Log in - DHIS 2 JIRA

This was the guidance we now use

I hope this makes sense.

Hi @ifeanyiokoye,
How are you? Have you solved this issue? I’m sorry I tried to reproduce it; however, it seems that the expression doesn’t recognize/support N{<indicator_id>}.

Would you like to create a new jira feature request issue to support N{<---->} for indicators?

One other way to solve this issue is to calculate the total sum for these indicators by using the API. You could then post this value to a data element.

Sorry for taking this long and thanks for your patience!

BTW, I have two points which might be temporary helpful:

If you make the “indicator of indicators” :slight_smile: in a separate section, it will not stop the other indicators from working. :+1:

I understand your situation but I think that this might by design that N{<–>} is not included which also causes an error in the code eventually stopping other indicators from working. We’ll a get confirmation and more insight from the developers after we create the jira bug / feature request issues.

On the other hand, I think even though API could solve the issue, another workaround might be to copy all the DEs in the Nominator and Denominator of each Indicator using CTRL + A then group them together. I hope it’s not as a long process as selecting one by one, but I’m not sure (again, probably using the API is your best bet for now!)

:+1:

Hello @Gassim,
Is this N{<program_id>} or should be N{indicator_id}?
This works. We have used it severally.
Thanks

Yes, sorry N{<indicator_id>} that one was a type. When we use N{indicator_id} it breaks the code in the dataset so it’s a bug.

Yes, I believe you that it might have worked in previous versions but when I tested it in 2.37.4 it’s not working this is why we can create a bug issue as well as a feature request.

@ifeanyiokoye Would you like to create it on jira.dhis2.org or would you like me to create it?

Thank you!

Please go ahead and create it.

Thank you so much.

1 Like

Thanks! I created it here and tagged your name:
N{indicator_id} breaks the code in datasets and stops other indicators in the same section from working [Jira bug issue - DHIS2-12896]

Please ‘watch’ to receive updates on this issue, and you can also add your vote and comments.

Thanks!

1 Like