← Back to team overview

dhis2-users team mailing list archive

Web API : Create Favourite

 

Hi,

I wanted to create a new favorite at pivot table that filters the date
values between a range of 500 to 1000.

I could get the output i needed using
http://xxx.xx.xx.xx:xxx
/x/api/analytics.json?dimension=dx:dHqbtLysQz0.fHcQdNbIBwQ:eq:0&dimension=ou:GYBZ1og9bk7&dimension=pe:LAST_12_MONTHS&displayProperty=NAME&skipMeta=true&measureCriteria=GT:500;LT:1000

I wanted to create a favourite for the same. I posted following json to
/api/reportTables/

{
    "columns": [{
        "dimension": "dx",
        "items": [{
            "id": "dHqbtLysQz0.fHcQdNbIBwQ",
            "name": "BMI (BMI 18.5-24.9, Female)"
        }]
    }],
    "rows": [{
        "dimension": "pe",
        "items": [{
            "id": "LAST_12_MONTHS",
            "name": ""
        }]
    },
    {
        "dimension": "ou",
        "items": [{
            "id": "GYBZ1og9bk7"
        }]
    }],
    "filters": [],
    "showDimensionLabels": true,
    "hideEmptyRows": false,
    "skipRounding": false,
    "aggregationType": "DEFAULT",
    "dataApprovalLevel": {
        "id": "DEFAULT"
    },
    "showHierarchy": false,
    "completedOnly": false,
    "displayDensity": "NORMAL",
    "fontSize": "NORMAL",
    "digitGroupSeparator": "SPACE",
    "legendSet": null,
    "sorting": null,
    "regression": false,
    "measureCriteria": "GT:500;LT:1000",
    "cumulative": false,
    "sortOrder": 0,
    "topLimit": 0,
    "rowTotals": true,
    "colTotals": true,
    "rowSubTotals": true,
    "colSubTotals": true,
    "reportParams": {
        "paramReportingPeriod": false,
        "paramOrganisationUnit": false,
        "paramParentOrganisationUnit": true
    },
    "name": "bmi_normal_female_w_LTGT"
}

But this doesn't seem to work. what's the dimension/criteria I should use
to get this done.

Thank you





-- 
Regards,
Pamod Amarakoon

Confidentiality Notice: the information contained in this email and any
attachments may be legally privileged and confidential. If you are not an
intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this e-mail is strictly prohibited. If you have
received this e-mail in error, please notify the sender and permanently
delete the e-mail and any attachments immediately. You should not retain,
copy or use this e-mail or any attachments for any purpose, nor disclose
all or any part of the contents to any other person.