Want to define last 8 weeks in pivot tables

Currently DHIS2 Pivot table default options for last week are “This week, last week, last 4 weeks, last 12 weeks, last 52 weeks”. But in our scenario we want to create a dashboard with pivot table which presents data of last 8 weeks.

Hey! Thanks for asking! Let me please ask you first, isn’t the last bi-month equal to last 8 weeks because last 8 weeks are the last two months? If I’m correct; otherwise, I’d still ask @Shurajit_Dutta for this one! :blush::+1:

Thanks @Gassim for your quick response. When we select last bi-month or this bi-month the data will show by month not by weekly. But we want see data of last 8 week by weekly.

1 Like

Yes, you are right, thanks! I once wanted the last five months period but that’s not available in the ‘relative’ period so what I did was select ‘last three months’ from the relative period and then manually select the two months after using ‘fixed period’ but that’s not a real long-term solution; however, it worked as a temporary solution.

I will ask for support to see if there’s a way; however, you might want to create a Jira feature request! I will make sure to add my vote as well. :+1:

Hi @jaz and @Gassim, not it is not possible. We have looked into adding a “Last x periods” for each of the relative period types: days, weeks, months, etc, but it has not yet been able to be prioritized. Do please make a jira ticket and tag me to it. Thanks!

1 Like

Yeah, thanks for the quick response @Scott! I think from 2014, right? (Relative Periods in Pivot Tables & reports) Definitely @jaz would you like to create the feature request? :smiley:

I haven’t taken the time to create a JIRA ticket yet, but have been thinking about more flexible approaches to handling relative periods in DHIS2, so this may be useful for anyone wishing to raise a ticket - and if you do, then I will round up support for this feature request:

More flexibility in the relative periods selection process will enable users to specify relative periods for a different time frame than those that are currently hard-coded as options, e.g. last week, 4 weeks, 12 weeks, 52 weeks >> why not e.g. last 2 weeks or 26 weeks? Or “past 4 months” or “past 21 days”? I’ve come across several instances recently where we need for example the past 2 weeks or the past 21 days as a relative period, yet it’s not currently possible in DHIS2.

From an end-user perspective, a very simple and intuitive solution would be to have complete freedom to specify the number of relative periods you want to rewind or fast-forward. I’d imagine something like the steps below, which can be compressed into one line in the relative periods selector in the UX (and would replace all the predefined options that we currently have):

  1. Select either “Current” or “Previous” (= Last) or “Next” (= Future)
  • Only if Previous or Next is selected >> display a field to enter the number of relative periods (= can be anything from 1 to say 52
  1. Drop-down with all period types, sorted from shortest (day) to longest (year) = similar to what currently exists in Data Visualizer.

Note how I included future relative periods: these would be useful e.g. when displaying predicted case values or estimated drug consumption levels, something which right now can only be done with fixed periods.

A separate option may be necessary to allow for the “periods this year” >> select [period type] “this year” or even “this financial year” (which I note in 2.35 exists for weeks, months, bi-months, quarters - but not for days or bi-weeks).