Using a constant value in an Events program

If I wanted to capture a constant value for each class in my org units, and use it later in calculations (indicators), how would I be able to do so? For example: capturing number of desks in an org unit as a constant value, and later using an event program (that monitors school items) to record number of damaged desks and deduct them from the constant value or record new number of new desks and add it to the opening stock. I am thinking of 2 solutions now:

  1. Using dataset (in Aggregate) assigned to all classes/org units to capture the opening stock. And using an event program to record future damaged desks, and new desks received.
  2. In a single Events Program, Number of new desks and number of damaged desk can be captured based on what the user wants to record. Then, the first submission/event of the event program that captures ‘number of new desks’ is used as the opening stock, and afterwards, subsequent events that capture ‘number of damaged desks’ is deducted from the first event, and other events that capture ‘number of new desks’ are added to the initial opening stock.

Do you think any of them could work? I’m eagerly waiting for ideas to implement this.

1 Like

Hi @Quoda ,

Thanks for your post.

As I understand you are intending to add desk stocks per each org unit, and the stock contains multiple items that contain aggregated values that need to monitor periodically (daily, weekly, monthly, or yearly), and you need to report the changes based on the period. If this is what you are intending to implement so, I am with the first solution you mentioned above in your post by creating a data set and adding sections accordingly to generate reports based on the period to monitor and compare the changes accordingly.

I hope this answers your question, please let me know if you require any further assistance or clarification.

Best regards,
Ayman

2 Likes

Thanks @Quoda, and thank you @ayman.tuffaha for support the discussion!

The initial value entered into the event program can be captured in the program indicator and thus it will be the same as if you had a ‘constant value’ especially if the constant value will change from time to time and from place to place, so why not capture the value (opening stock) directly in one event program?

Thanks @Gassim ,

Yes, I believe more details about the requirements will give us a better approach to selecting.

A data set in DHIS2 is a collection of data elements that are used to collect, store, and report on specific health information. These data sets are typically used to track things like patient demographics, disease outbreaks, and health facility information. They can be created and customized by users to meet specific needs and can be used to generate reports and visualizations.
Event capture, on the other hand, is a feature in DHIS2 that allows users to track and report on specific events or activities. These events can include things like patient visits, vaccination campaigns, and training sessions. Event capture data can be collected through forms, and it can be used to generate reports and visualizations.

In summary, a data set in DHIS2 is a collection of data elements used to collect and report on specific health information, while event capture is a feature that allows users to track and report on specific events or activities. Both data sets and event capture can be used to generate reports and visualizations in DHIS2.

Best regards,
Ayman

1 Like

@ayman.tuffaha and @Gassim Thanks for your contributions.

I want to clarify that this ‘constant value’ will be different from org unit to org unit, but won’t change value.
@ayman.tuffaha Using the data set (in option 1) is something I know is possible but I’m trying to avoid building complex user workflows, and trying to stick to tracker/event programs. So I actually find @Gassim 's suggestion here very interesting and would like to explore this.

The initial value entered into the event program can be captured in the program indicator.

In setting up the program indicator, how do I specify the initial value entered into the event program in the Expression? Thanks to you all in advance!

1 Like

Thanks @ayman.tuffaha and @Quoda!

During the creation of the program indicator, you have the option to select either (data elements, variables, or constants). For instance, damagedDesks - desks, the ‘desks’ is the data element which will be assigned a number in the first first stage and the ‘damagedDesks’ should be zero in the first stage.

One interesting idea since this value (number of new desks) will remain constant, it could be possible to assign a data element an initial value using a program rule. For example, if I have a set of organization units that can be put into groups, so if one OU could have the code OU_Big, the data element will be assigned the value 100 (desks) but if the code is OU_Small it will be assigned 50 (desks)…etc but if it’s not possible to classify OUs into groups, it might be challenging to use a program rule.

Therefore, in the case where each constant number could be unique then the initial value will need to be entered by the users into a data element, and this data element will be used as the initial value in the program indicator.

Probably some more testing is required, but hope this helps!

Thank you!