List which have subitems and sometimes not

Here is the link to the .dyn file.

I think i now got it to work by adding a list.chop and list.count in front of some list.filter by boolean. Thanks for all the replies pointing me in the right direction:)