Hello,
We have a slight issue with the showEmptyValues option.
In principle, we want users to have the feature to show any dimension with entirely null values, but without having them be replicated across children. I don't have a JSFiddle ready, so I refer you to my (very simple) examples below.
Jan
Feb
Mar
US
300
250
250
… Reps
NULL
NULL
NULL
… Operations
100
50
150
… Staff
200
200
100
GB
50
140
150
… Marketing
25
75
50
… Staff
25
65
100
Let's say we have a data source that follows the above structure. We have two parents (US, GB), and they each have some unique members and a shared member (staff). In this case, US has a member "reps" that has only null values. Without "show empty values" enabled, the user will see this:
Jan
Feb
Mar
US
200
200
100
… Operations
100
50
150
… Staff
200
200
100
GB
… Marketing
25
75
50
… Staff
25
65
100
In the above example, we're missing the "Reps" member under US.
If we enable show empty values, however, we come across this:
Jan
Feb
Mar
US
300
250
250
… Reps
NULL
NULL
NULL
… Operations
100
50
150
… Staff
200
200
100
… Marketing
NULL
NULL
NULL
GB
50
140
150
… Marketing
25
75
50
… Staff
25
65
100
… Operations
NULL
NULL
NULL
… Reps
NULL
NULL
NULL
Essentially, every child-member is replicated to its parent's siblings if it doesn't already exist there. Now, the above is an issue for us. Because the user expects only to see data that correlates with the hierarchy established in their database. With the initial implementation of "show empty values", FlexMonster will generate a cross-section of members that do not necessarily have a database correlation.
Is there a way to essentially implement:
"Show empty values (but only for dimensions that exist in the data source)"?
Thank you very much for your help 🙂
Best regards,
Jonas
Hello,
Thank you for contacting us.
We suggest considering using multilevel hierarchies if you want to display only the existing children.
Flexmonster recursively analyzes members of each level to build up the internal structure when building the multilevel hierarchy. As a result, Flexmonster does not display non-existing tuples when the showEmptyValues
property is set to true.
You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/dj82a4z7/.
Please let us know if it works for you. Looking forward to hearing from you.
Kind regards,
Nadia
Hi there,
I think this solution may be feasible for us. We already have a sort of forced hierarchy, however this is achieved via a workaround where all the rows are "flattened" to one level and then a hierarchy is established after the fact. This ensures that there is no "phantom dimensions" being created.
However, an unfortunate effect of this is that many aspects of a row member's data is "tainted". For example, rowData.level does not work accurately, and the hierarchy information is also not great.
Does this solution fully retain the data as we would expect it from rows? E.g. using this mapping:
dataSource: {
data: getData(),
mapping: {
"Price": {
type: "number"
},
"Country": {
hierarchy: "Hierarchy",
},
"field1": {
hierarchy: "Hierarchy",
parent: "Country"
}
}
If we access a member within field1, e.g.
"US.Reps.rows()" would we get an array of strings where each level is the given parent of reps?
i.e.
"country.[US]", "field1.[Reps]"?
Because our solution right now, unfortunately, would provide a single string as such:
"hierarchyName.[US].[Reps]" which is not ideal. It makes getting certain data a major hassle. I.e. getting the "path" to a row tuple becomes much more complex rather than just getting "selectedCell.rows".
Thank you in advance.
Hello,
Thank you for the response.
It is possible to get an array of strings, such as ["country.[US]", "field1.[Reps]"]
. It requires preformatting the cell data using the data from the getAllHierarchies
API call. You can find the suggested approach in the following JSFiddle: https://jsfiddle.net/flexmonster/dj82a4z7/
In the example above, you can click on the cell, and it will print the array of members' names.
If it is not the desired result, please provide us with more details on such a use case.
Please let us know if this helps. Looking forward to hearing from you.
Kind regards,
Nadia
Hello again,
Is there no way to do it such that the data is nested within the CellData? Rather than having to generate it when we need it? In any case where we don't need multi-level hierarchies, we find that FlexMonster is really great at providing the data we need. Getting columns and rows is extremely simple. While it is not a big issue, it is slightly problematic to always have to add conditions for multi-level hierarchical rows. In one instance it's not an issue, but across the entire software it does introduce a lot of bloat, variability, and maintenance.
As always, we are very thankful for your help! 🙂
Hello,
Thank you for the response.
Currently, it is only possible to get the present data from the CellDataObject
and process it to receive the desired result. We recommend sticking to the approach from our previous message.
You are welcome to write to us in case further questions arise.
Kind regards,
Nadia
Thank you for the help 🙂
Hi,
Thank you for the feedback.
Please don't hesitate to reach out if you have any further questions.
Kind regards,
Nadia