← Back to team overview

dhis2-users team mailing list archive

Re: Print list of data element values

 

For that, I think you would need to do something like Crosstab in your SQL:

Here is an example:

http://stackoverflow.com/questions/3002499/postgresql-crosstab-query

On Tue, Apr 14, 2015 at 9:23 PM, Joao Mazuze <Joao_Mazuze@xxxxxxxxxxxx>
wrote:

>  Hi Greg,
>
> Is there a way of adjusting the query to produce something like this?
>
>
>
> *A*
>
> *B*
>
> *C*
>
> *D*
>
> *D*
>
> *…..*
>
> *M*
>
> *32323*
>
> *sssssss*
>
> *dgfgfgf*
>
> *ffgfgf*
>
> *fgfgfg*
>
> *fff*
>
> *S*
>
>
>
> Where A,B,C,…,M  are dataelements and the second line are respective
> values for any specific program stage?
>
>
>
> Kind regards,
>
> Joao
>
>
>
> *From:* Greg Rowles [mailto:greg.rowles@xxxxxxxxx]
> *Sent:* 14 April 2015 16:15
> *To:* Joao Mazuze
> *Cc:* dhis2-users@xxxxxxxxxxxxxxxxxxx
> *Subject:* Re: [Dhis2-users] Print list of data element values
>
>
>
> sorry, using this:
>
>
>
> SELECT program.uid as ProgUID, program.name as Prog,
> trackedentityattribute.trackedentityattributeid as ProgAttribID,
> trackedentityattribute.uid as ProgAttribUID, trackedentityattribute.name
> as ProgAttrib, programstage.uid as ProgStageUID, programstage.name as
> ProgStage, dataelement.dataelementid as ProgStageElementID, dataelement.uid
> as ProgStageElementUID, dataelement.name as ProgStageElement FROM
> public.program, public.program_attributes, public.trackedentityattribute,
> public.programstage, public.programstage_dataelements, public.dataelement
> WHERE program_attributes.trackedentityattributeid =
> trackedentityattribute.trackedentityattributeid AND
> program_attributes.programid = program.programid AND programstage.programid
> = program.programid AND programstage_dataelements.programstageid =
> programstage.programstageid AND dataelement.dataelementid =
> programstage_dataelements.dataelementid ORDER BY program.name,
> trackedentityattribute.name, programstage.name, dataelement.name
>
>
>
>
>
>
>
> On Tue, Apr 14, 2015 at 4:14 PM, Greg Rowles <greg.rowles@xxxxxxxxx>
> wrote:
>
> Hi Joao
>
>
>
> Create a SQLview using this:
>
>
>
> On Tue, Apr 14, 2015 at 3:34 PM, Joao Mazuze <Joao_Mazuze@xxxxxxxxxxxx>
> wrote:
>
>   Hi all,
>
> How do I print a list of data element values in a program stage? I have
> configured some of them to be displayed in reports, is there ba way to
> display that list?
>
>
>
> Kind regards
>
>
>  ------------------------------
>
> This message may contain privileged and confidential information intended
> solely for the addressee. Please do not read, disseminate or copy it unless
> you are the intended recipient. If this message has been received in error,
> we kindly ask that you notify the sender immediately by return email and
> delete all copies of the message from your system.
>
>
>
> _______________________________________________
> 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
>
>
>
>
>
> --
>
> *Health Information Systems Program - South Africa*
>
> *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
>
> Mobile  :    073 246 2992
> Landline:   021 554 3130
>
> Fax:          086 733 8432
>
> Skype:      gregory_rowles
>
>
>
>
>
> --
>
> *Health Information Systems Program - South Africa*
>
> *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
>
> Mobile  :    073 246 2992
> Landline:   021 554 3130
>
> Fax:          086 733 8432
>
> Skype:      gregory_rowles
>
>
> ------------------------------
> This message may contain privileged and confidential information intended
> solely for the addressee. Please do not read, disseminate or copy it unless
> you are the intended recipient. If this message has been received in error,
> we kindly ask that you notify the sender immediately by return email and
> delete all copies of the message from your system.
>
> _______________________________________________
> 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
>
>


-- 
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org

References