Please refer to the basic tutorial on program indicators if you are not yet familiar with the concept of program indicators.
You may have noticed that data elements and attributes which use option sets are not available to be used in expressions. Expressions can only use numerical or yes-only items directly. In order to use data elements with option sets, we will use a filter combined with a variable in the expression to count the number of items being filtered.
In this example we will be creating a program indicator for a single-event TB program.
From this program, we want to filter cases with the following attributes:
Between the ages of 0-4
Sex is Female
There is also a data element with option set, “TB Patient Type.” In this case we only want New cases. Therefore our filter is:
Sex == 'Female' and Age (in years) ≤ 4 and TB Register.TB Patient Type == 'New'
Start by entering the description details for the program indicator. Notice in this case the aggregation type being used is count. This will count the number of events that return a true value based on the filter we have made.
When we define our expression, we want to count the number of events which meet the criteria of the filter we will create. We can select the count of events in two locations.
- Using the variables tab
- Next to the expression operators
For events with multiple stages or movement between programs, you can also count enrollments and entities depending on the criteria of your calculation.
After you have selected the count of events variable to use in the expression, you can now create the required filter. A mix of attributes and data elements have been used to create the filter as described previously. This filter will return a true or false result. When true, the event will be counted based on the defined expression.
Click on “Add” to save the program indicator. This program indicator can now be used within the aggregate pivot table, GIS and data visualizer apps as well as in standard reports.