Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Hierarchy List Box question

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?

Thanks,

Scott

8 Replies
Highlighted
Not applicable

Hierarchy List Box question

Does anyone have an idea here? Or a work around?

If not, can we make the entries that have children appear at the top? I think I've seen that somewhere.

Highlighted
Partner
Partner

Hierarchy List Box question

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

Oscar

Highlighted
Not applicable

Hierarchy List Box question

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?

Highlighted
Partner
Partner

Hierarchy List Box question

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 [

Test

13_465_789_XYZ

456_123_798_MNB

ABC

789_321

987

];
"ABC" and "987" are not going to show in my list box because of the expression created.


Highlighted
Not applicable

Hierarchy List Box question

My scenario is something more like:

LOAD * INLINE [

Test

Parent1

Parent1_ChildMike

Parent1_ChildBob

Parent2

Parent3

Parent3_ChildRay

Parent4

Parent5

Parent5_ChildKate

];

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.

Highlighted
Partner
Partner

Hierarchy List Box question

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:

T:

LOAD * INLINE [

Test

Parent1

Parent1_ChildMike

Parent1_ChildBob

Parent2

Parent3

Parent3_ChildRay

Parent4

Parent5

Parent5_ChildKate

];

T1:

Load

subfield(Test, '_', 1) as Parent,

subfield(Test, '_', 2) as Child,

Test

Resident

T

Where

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.

Oscar

Highlighted
Not applicable

Hierarchy List Box question

Hi,

go through this sample application it will help u

Regards,

Sampath Kumar . G

Highlighted
Not applicable

Hierarchy List Box question

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.