Metadata that can help me create a specific chart

Hi Everyone,

I want to create a chart that shows new admissions disaggregated by Gender. My current data element is disaggregated with age group, gender and ward. New admissions are determined by the date (for an example today’s date). with the metadata that I have how can I create a chart that looks like the one in the picture below:

Is anyone gonna help me with this?

Hi @1c699b409a68f19fba95

Thanks for the post with the visualization. I tried to recreate it but it looks like it might require more metadata configuration. I will ask the team, but for now, I would like to recommend something similar to this: Mean Line On Visualization - #2 by Gassim

Thank you for the feedback, but this is not going to work for me. Yes, more metadata configuration but I just want to know how to go about doing it.

Could you explain this further? Thanks!

I have a data that I have to visualise. It is disaggregated using the age group, sex and ward(created these as a category option combo for the data element in dhis2). For the dataset that imports this data into DHIS2, I use the admission date as a period. On the visuals they want a bar chart that looks like the one I attached earlier that shows the sex disaggregation then shows new admissions versa vee total admissions. the new admissions displaying on today’s chart as an example should be admissions that were imported into DHIS2 from the previous day and they total admissions will depend on the default period that I set when creating the chart, for an example if I set Last 7 days for the chart, the total admissions will be the total number of admissions imported into DHIS2 from the last 7 days vs the ones that were imported previous day(New Admission), Question is how do I calculate previous day admissions when creating the bar chart

1 Like

Hi any feedback?

1 Like

Thanks for the detailed explanation!

Update: the issue below was due to a cache issue. Thanks @jan for the help!

I’m sorry I tried several times to reproduce this but there’s an issue with creating the chart when I add the dimension so I will triage to the team.

Adding Dimension Breaks

  1. Created the Category Options, Category, and Category Combination (and updated all sharing settings)
  2. Created the Data Element and added the category combination
  3. Created the Dataset, updated the sharing settings and entered data (double checked the user’s sharing settings)
  4. Created the Visualization using the Data Visualizer app
  5. Visualization looks good but when I add the data dimension, it breaks.

I also ran the analytics tables export without skipping anything…
Debug info:
{
“app_name”: “Data Visualizer”,
“app_version”: “101.3.7”,
“global_shell_version”: “1.9.0”,
“dhis2_version”: “2.42.3”,
“dhis2_revision”: “39a1b7d”
}

From the Network tab, I can see:
Fetch request:

fetch("https://play.im.dhis2.org/stable-2-42-3/api/42/analytics?dimension=dx%3Am0v3ATkNXx1,pe%3A20251110%3B20251109%3B20251108%3B20251107%3B20251106&filter=FIetlAtuRWu%3AcPjKqTe84eN%3BxKX5GzWo0Q2&filter=ou%3AImspTQPwCqd&displayProperty=NAME&includeNumDen=false&skipMeta=false&skipData=true&includeMetadataDetails=true", {
  "headers": {
    "accept": "application/json",
    "sec-ch-ua": "\"Chromium\";v=\"142\", \"Google Chrome\";v=\"142\", \"Not_A Brand\";v=\"99\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "x-requested-with": "XMLHttpRequest"
  },
  "referrer": "https://play.im.dhis2.org/stable-2-42-3/dhis-web-data-visualizer/index.html?redirect=false",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "omit"
});

Response:

{"headers":[],"metaData":{"items":{"ou":{"uid":"ou","name":"Organisation unit","dimensionType":"ORGANISATION_UNIT"},"cPjKqTe84eN":{"uid":"cPjKqTe84eN","code":"Male-Test","name":"Male-Test","dimensionItemType":"CATEGORY_OPTION","valueType":"NUMBER","totalAggregationType":"SUM"},"pPY1NIAC77R":{"uid":"pPY1NIAC77R","name":"Male-Test","valueType":"NUMBER","totalAggregationType":"SUM"},"FIetlAtuRWu":{"uid":"FIetlAtuRWu","name":"Sex-Test","dimensionType":"CATEGORY"},"20251109":{"uid":"20251109","code":"20251109","name":"2025-11-09","dimensionItemType":"PERIOD","valueType":"TEXT","totalAggregationType":"SUM","startDate":"2025-11-09T00:00:00.000","endDate":"2025-11-09T00:00:00.000"},"ImspTQPwCqd":{"uid":"ImspTQPwCqd","code":"OU_525","name":"Sierra Leone","dimensionItemType":"ORGANISATION_UNIT","valueType":"TEXT","totalAggregationType":"SUM"},"20251107":{"uid":"20251107","code":"20251107","name":"2025-11-07","dimensionItemType":"PERIOD","valueType":"TEXT","totalAggregationType":"SUM","startDate":"2025-11-07T00:00:00.000","endDate":"2025-11-07T00:00:00.000"},"20251108":{"uid":"20251108","code":"20251108","name":"2025-11-08","dimensionItemType":"PERIOD","valueType":"TEXT","totalAggregationType":"SUM","startDate":"2025-11-08T00:00:00.000","endDate":"2025-11-08T00:00:00.000"},"rabxsCdpe5F":{"uid":"rabxsCdpe5F","name":"Female-Test","valueType":"NUMBER","totalAggregationType":"SUM"},"dx":{"uid":"dx","name":"Data","dimensionType":"DATA_X"},"pe":{"uid":"pe","name":"Period","dimensionType":"PERIOD"},"xKX5GzWo0Q2":{"uid":"xKX5GzWo0Q2","code":"Female-Test","name":"Female-Test","dimensionItemType":"CATEGORY_OPTION","valueType":"NUMBER","totalAggregationType":"SUM"},"m0v3ATkNXx1":{"uid":"m0v3ATkNXx1","code":"Admision-Test","name":"Admision-Test","description":"Admision-Test","dimensionItemType":"DATA_ELEMENT","valueType":"NUMBER","aggregationType":"SUM","totalAggregationType":"SUM"},"20251110":{"uid":"20251110","code":"20251110","name":"2025-11-10","dimensionItemType":"PERIOD","valueType":"TEXT","totalAggregationType":"SUM","startDate":"2025-11-10T00:00:00.000","endDate":"2025-11-10T00:00:00.000"},"20251106":{"uid":"20251106","code":"20251106","name":"2025-11-06","dimensionItemType":"PERIOD","valueType":"TEXT","totalAggregationType":"SUM","startDate":"2025-11-06T00:00:00.000","endDate":"2025-11-06T00:00:00.000"}},"dimensions":{"dx":["m0v3ATkNXx1"],"pe":["20251110","20251109","20251108","20251107","20251106"],"ou":["ImspTQPwCqd"],"co":["rabxsCdpe5F","pPY1NIAC77R"],"FIetlAtuRWu":["cPjKqTe84eN","xKX5GzWo0Q2"]}},"rowContext":{},"width":0,"rows":[],"headerWidth":0,"height":0}

Hi again Sakhile @1c699b409a68f19fba95,

The following chart was the closest I could get to the chart you shared above:

I added two periods (today) which will count for new enrollments, and a relative period (for example, last week) which will count for previous enrollments, and the period dimension is added to the ‘Series’. The category combination is added to the ‘Category’ showing Female and Male admissions.

You can find this chart if you use the following link before the play instance resets in the next day: Login app | DHIS2

Thank you for this.

1 Like

You’re welcome! :slight_smile:

Please do mark the post as solved if it provides a solution to your question. :folded_hands:

Thanks!