What is advantage of using an Option set with Yes/No options attached to a data element rather than a Yes/No Value Type Data element

Hi all,

I would like to know the difference between a data element with an Option set with Yes/No options attached to it a Yes/No Value Type Data element. Which would be infinitely preferable? Iam in about whether to use the first or the second.


I Have the same doubt

Hi Davuya,

I assume you’re talking about Program data elements here, since Yes/No isn’t used very often in Aggregate?

The main difference is that:

  • With Yes/No, I think the underlying value is stored in the database as true/false (with a non-response stored as null), but will then be rendered as 1 or 0 in the analytics tables.
  • With an Option Set you can choose your own underlying value for Yes and No, and add other options if needed. You can, for example, record a ‘Not stated’ option, so you can distinguish between true missing data and incomplete data capture.

Having said that, I think 1 and 0 is still a great choice for Yes/No values even with your own Option Set, as it gives you lots of useful options within program indicators. (For example, you can easily count values to get a denominator and sum values to get a numerator within a single program indicator.)

There used to be bugs in DHIS2 with how the Yes/No value type displayed in analytics, so you might find some older users (like me!) have fallen into the habit of creating their own Yes/No Option Sets, rather than using a Yes/No data type. But I’m pretty sure those bugs have been fixed by now, so it should be fine to use either.

Cheers, Sam.

1 Like

Hi @SamuelJohnson,

I am perfectly happy with your explanation.

Thank you very much

I’d like to know about Aggregate Data Elements here…

I have a data element that has two options - yes or no OR… Complete/Incomplete OR Teacher/Healthworker…

So my questions are as follows:

  1. When I input the data type as yes/no then proceed to select the option set for my two options… When I save and I go back to find that it saved the data type as Text rather than Yes/No… Is it because I have specified an option set?

  2. I want to count in the form, how many are selected yes and how many no. Not sure how to do this and I am exploring with the count aggregation type but as it stands no success yet.

Any ideas?