Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Force all members of a hierarchy to be shown

Ilaria asked on June 25, 2020

I would like to ask some tips on how to force all members of a hierarchy to be shown, for example I have a ‘Date’ field with members ‘Jan 2020’, ‘Feb 2020’,….. ‘Dec 2020’. I want these values to always be visible even if there are no corresponding data, for example, if I filter for some records and it happens that they don’t have data on Mar 2020, I don’t see Mar 2020. I looked by my self for workarounds but I didn’t find any acceptable solution.
For sure I have to set the option ‘showEmptyData’ to true; I have some limitations:

  • data set are usually very huge, so I can’t manually add ‘fake records’ foreach data in order to cover empty months
  • I can’t use for now the custom data source (I’m planning to implement it, but it will require me a lot of time and I need a faster solution). For now I can only use json DataSource.
  • The final user can modify the layout, so that the Date field can be in rows, or in columns
  • The final user can apply filters (also on the Date field and in this case only the selected month should be visible)

Do you have any suggestions? 
Thank you!

7 answers

Vera Didenko Flexmonster June 25, 2020

Hello, Ilaria, 
Thank you for reaching out to us. 
For such cases, we kindly recommend using the showEmptyValues option.
Please see the following JSFiddle we have prepared for you:
In the example, when the showEmptyValues is set to true, all the date members are shown even if the filtered records don’t have data associated with a certain date member.
More details about the showEmptyValues option are available in the corresponding guide:
Please let us know if this would work fine for you.
Looking forward to your reply. 
Kind regards, 

Ilaria June 29, 2020

First of all thank you for your quick answer!
Actually I’m not sure I can use ‘date string’ format, because I’m not using gregorian calendar, but a calendar based on the ‘fiscal year’. For such a calendar, for example, year starts on the first week containing September 1st, so that 2020 starts on 31/08/2019. For that reason I implemented by own hierarchy in order to aggregate dates.
Consider the dates
– 24/08/2019
– 31/08/2019
– 07/09/2019
Year 2020 starts on 31/08/2019 so:
– 24/08/2019 correspond to the last week of 2019, the hierarchy is Year 2019, Month 12, Week 52
– 31/08/2019 correspond to the first week of 2020, the hierarchy is Year 2020, Month 01, Week 01
– 07/09/2019 correspond to the second week of 2020, the hierarchy is Year 2020, Month 01, Week 02.
Here is a JSFiddle. If you filter for ‘apple’ the hierarchy for 2019 is empty.
How can I get the Week 52 always visible?
Thank you!

Vera Didenko Flexmonster June 30, 2020

Hello, Ilaria,
Thank you for your reply and for providing further details.
Our team will provide an update so that all hierarchy levels are also visible if the showEmptyValues option is enabled.
This will be available in the minor release version with the ETA 27th of July.
Please let us know if this would work for you.
Kind regards, 

Mykhailo Halaida Mykhailo Halaida Flexmonster July 28, 2020

Hi Ilaria,
We are happy to inform you that the issue with drilling down hierarchy levels when showEmptyValues: true option is enabled was fixed.
This is available in the 2.8.12 version of Flexmonster:
You are welcome to update the component. Here is our updating to the latest version guide for assistance:
Please let us know if you have any questions we can assist you with.
Best regards,

Mykhailo Halaida Mykhailo Halaida Flexmonster August 6, 2020

Hi Ilaria,
How are you?
We were wondering if you’ve had a chance to check out the fix we’ve mentioned in our previous response. Was it helpful, or is there still anything we can help you with?
Please let us know what you think.
Best regards,

Ilaria October 15, 2020

the fix you mentioned in your previous response was helpful: the JSFiddle sample works, indeed.
But I’ve another case for which the “showEmptyValue” option doesn’t behave as I expect.
I have 3 record in my dataSource (month in columns, aggregated by year)

  • apple in Dec2019
  • orange and pear in Jan2020

If I set a filter excluding ‘apple’
What I expect:

  • Column 2019 (empty) with child Dec2019 (empty)
  • Column 2020 (TotValue = 2) with child Jan2020.

Instead I obtain:

  • Column 2019 (empty) but not expandible
  • Column 2020 (TotValue = 2) with two children: Dec2019 (empty) and Jan2020 (TotValue = 2).

Here a JSFiddle.
Thank you in advance!
Kind regards,

Mykhailo Halaida Mykhailo Halaida Flexmonster October 16, 2020

Hi Ilaria,
Thank you for writing to us.
The described behavior does look strange – we will take a look at this and return to you ETA Nov 16th.
Please let us know if there’s anything else we can help you with in the meantime.

Please login or Register to Submit Answer