← Back to team overview

dhis2-users team mailing list archive

Re: Option sets in program indicators

 

Natalie,

I don't think your proposed formula would work if the data are stored as
text; however, if you convert your option sets to an INTEGER value type, it
would.  You could update the metadata configuration in place using a PATCH
request to the /api/optionSets/id endpoint to update the value type without
having to change them in the UI.  You'd also need to update the associated
data element or tracked entity attribute value type using the same method.
Then you could remove the quotes around your number codes.

I haven't tried with d2:hasValue, but I imagine this would work as well.

Aaron


--
Aaron C. White
919.522.5585

On Tue, Apr 10, 2018 at 12:15 PM, Natalie Tibbels <ntibbel1@xxxxxxx> wrote:

> Hi all,
>
> For program indicators, do option set codes count as number values in an
> expression/filter? I want to create a program indicator that captures
> whether ANY response was given to a particular data element in a tracker
> program stage (with response type text using an option set with 11 options,
> codes: 01, 02, 03…11). I want to sum all of the cases where the user
> selected ANY option for that data element.
>
>
>
> Does this make sense?
>
> Program expression: Enrollment count. [or TEI count?]
>
> Program filter: {#uidofdataelement} >='01' and
> #{CDbxAsttXzY.mFhpwpIv7ci}<='11'
>
>
>
> Is there a better way to do this? Am I right that d2:hasValue cannot be
> used if the response type is an option set?
>
>
>
> Thanks,
>
> Natalie
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>

References