Discussion Board for collaboration related to QlikView App Development.
I am wondering if in a tree-view hierarchical list box it is possible to exclude parents with no children. So I would like to see the entries that "roll up" and aggregate with a plus sign on the left (and all of their children) but not see entries which do not "roll up". Is that possible?
You can try something like this.
Create a list box with the expression editor to limit the values you want to see.
YourField and whatever your separator is are the important pieces here. I'm using the underscore as my separator in my example. The FindOneOf function will return the number of times it found your separator in YourField. So if you use the if statement to check if your returned value is greater than zero, either return your value or a null value.
=If(FindOneOf( YourField, '_')>0, YourField, Null())
Hope this helps
I was thinking about something like that because that would give me all the children, but in that scenario the parents would show up in the list box as greyed out entries that you can't select. I'd like to also include parents that have children - only excluding parents without children. Do you think we could also do this in the expression list box?
Can you include a sample of your data for your list box?
I was going under the assumption that your data would include separators between the parts. In my example I was using "_" the underscore as my separator.
So if I'm looking at the following data:
Load * Inline [
My scenario is something more like:
LOAD * INLINE [
So in a hierarchy list box with _ as the separator and the findoneof function, Parent4 and Parent2 would be excluded properly, but Parents 1, 3, and 5, would also be excluded. To be specific, they would show up in the list box but be greyed out and not selectable (as shown below). I am trying to find a way to exclude parents 2 and 4 but keep parents 1, 3, and 5 and all of their children.
With the tree view on the list box the results you are currently getting is what's expected. The children are still related to the parent. Just that you cannot select the parent. If you need to select the parent, you can use the subfield function to extract and separate the parent and child as follows:
LOAD * INLINE [
subfield(Test, '_', 1) as Parent,
subfield(Test, '_', 2) as Child,
FindOneOf(Test, '_') > 0
Hopefully this is what you're looking to do.
The where clause is optional. You can then create list boxes for your parent and child.
I have edited your QVW and re-attached it. I included a parent with no children, "AParentNoChild". My question is how to exclude this person from the ReportsPath list box, or if that is possible. Thanks.