Relative periods don't work with Weeks starting Sunday in Data Visualizer

My organisation uses weeks starting Sunday. I would like to create a table containing data for the last 4 weeks. However when I use Last 4 Weeks as the period in the Data Visualizer app I get a “No Data Available” result.

The query would return data if we used the default week (starting Monday) as the period type when creating the data set, but this doesn’t reflect the true reporting period.

Is there a way to use relative periods with weeks starting Sunday?

We are using version 2.39.4.1.

Thanks for any assistance.

Hi @thisisdaryn

You are on the right path using the fixed period with the specific starting day of the week that you need; however, it’s not possible to use the fixed period and choose a specific starting day of the week.

It’d be great if we can figure out why it’s returning “no data available.” If you can reproduce this on any of the play.dhis2.org instances then please share the steps… If not, we need more info to understand if there’s a bug here or a configuration/DB issue.

Thank you!

Hi,

I’ve used the 2.39.4.1 instance an it is being reproduced there.

Steps:

  1. Create four data elements Syn Test Element 1, Syn Test Element 2, Syn Test Element 1 (Default Week) and Syn Test Element 2 (Default Week) each of which are aggregate data with value type of Positive or Zero Integer
  2. Create two data set Syn Test Set (containing Syn Test Element 1 and Syn Test Element 2) and Syn Test Set Default (containing Syn Test Element 1 (Default Week) and Syn Test Element 2 (Default Week) with Period types WeeklySunday and Weekly respectively.
  3. Enabled both data sets for the Bo and Bambali organisationunits.
  4. Changed the sharing settings on the data sets so that public can capture and view the data
  5. Go into Data Entry app. Entered some data for the last 4 weeks (Epi Weeks 13 to 16 2024) for both data sets. Mark data sets complete for all weeks.
  6. Go to the Data visualizer and create 6 queries:
    • Syn Test Query Set 1 - Fixed Periods Column (Works and returns a chart)
    • Syn Test Query Set 1 - Fixed Periods Pivot (Works and returns a pivot table)
    • Syn Test Query Set 1 - Relative Periods Column (Does not work)
    • Syn Test Query Set 1 - Relative Periods Pivot (Does not work)
    • Syn Test Query Set 2 - Relative Periods Column (Works and returns a chart)
    • Syn Test Query Set 2 - Relative Periods Pivot (Works and returns a pivot table)

For all of the charts above you can use the following rules:

  1. For queries containing “Set 1”, select the two data elements Syn Test Element 1 and Syn Test Element 2
  2. For queries containing “Set 2”, select the two data elements Syn Test Element 1 (Default Week and Syn Test Element 2 (Default Week)
  3. For all visualizations select Bo and Bambali organisation units
  4. For Relative Periods visualizations use Relative Periods → Last 4 Weeks
  5. For Fixed Periods visualizations, manually select Weeks 13 to 16 of 2024
  6. For Pivot table visualizations use Columns: Data and Rows: Period and Organisation unit
  7. For Column visualizations uses Series: Data and Category: Period and Organisation unit

Edit:

When I create a single Pivot Table visualization containing all 4 data elements with the period set as Last 4 weeks, it returns a table where the first two data elements (collected via the default WeeklySunday form are shown as blank).

Relative Periods Pivot Table with all data elements

  • I hope this helps. Thanks
    Daryn