Constant value

Hi all.

I want to assign a constant (a value that will not change) to data element in a program stage. What do I write in the program rule expression?

The data element with the assigned value will then be used as a denominator to calculate indicators. The value must not be entered by the user.

Explained in other words:

An event program is composed of several sections. Each section contains a number of yes/no questions and a data element that contains a constant value. The indicator for each section should be Numerator (number of yes answers)/denominator (data element with the assigned value)

Why do we choose to assign a constant value? because the constant value of each section should also be viewed in an event report.

Thanks

1 Like

If we assign a value using a program rule, it’s going to be okay and greyed out for users to enter? Would that suffice and act as const?

1 Like

Hi @jthomas,

We do not know if that will suffice for the value to be a considered as a constant. Any clues/ hints from your side are welcome.

And how would the program rule expression be in this case?

In the example below. 20 is a fixed value for the section with 4 yes/no questions. The number of yes answers is divided by this value to get the percentage.

image

Thanks

1 Like

I think what you need is not const, but an option sets of Yes/No with an option code of these values,

and you calculate scores using program indicators.

1 Like

Hi @jthomas,

Thad’s an interesting idea, but I think it can be difficult because depending on the yes answer in each data element the value that must be assigned to the data element is different. In the other part of the table below , if the answer is yes to first data element, we must assign value 10 to it. For the second and third data elements, we must assign value 20 if the answer is yes and for the fourth and fifth data elements, we must assign value 15 if the answer is yes.

image

Note; If the answer is No to any data element, the value assigned is zero.

Would option sets work in this case?

Thanks

1 Like

I think it’s still possible in the following way you give code 1 to Yes and code 0 to No

In program indicators you can do *10 , *5 etc based on your design requirement,

Have seen people using dhis2 for supervision score calculation based on questions like this, so most likely it’s possible i think

1 Like

Hi @jthomas,

Regarding your comment below, I think of summing all data elements with yes answers multiplied by weight/divided by total weight. But what aggregation type would I use for the program indicator and how to obtain %

I am building this evaluation tool as an event program (filled biannually) that is assigned to several facilities.

Thanks