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:
Do you have any suggestions?
Thank you for reaching out to us.
For such cases, we kindly recommend using the
Please see the following JSFiddle we have prepared for you: https://jsfiddle.net/flexmonster/2rch3tax/
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
More details about the
showEmptyValues option are available in the corresponding guide: https://www.flexmonster.com/api/options-object/
Please let us know if this would work fine for you.
Looking forward to your reply.
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
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 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.
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: https://www.flexmonster.com/release-notes/
You are welcome to update the component. Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/
Please let us know if you have any questions we can assist you with.
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.
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)
If I set a filter excluding ‘apple’
What I expect:
Instead I obtain:
Here a JSFiddle.
Thank you in advance!
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.