How to remove empty results from a list widget

I have a dynamic table in which I am trying to categorise and subcategorise lists like shown in this image using defined tiddler fields.

Those in bold are the categories and those in underline italics are the subcategories.

Category list was working well -not shown in this demo. But when I tried to add subcategories, the result is not good. Category and subcategory tiddler fields without any fieldvalues for the given filter are also getting listed as category and subcategory headers. How to solve this ?

Below is the code for the subcategory headers

tbl-category-selector={{!!tbl-category-selector-value}}
tbl-category-selector-fieldvalues=`[$(tbl-filter-mod)$get[$(tbl-category-selector)$]enlist-input[]sort[]] +[unique[]]`
tbl-subcategory-selector={{!!tbl-subcategory-selector-value}}
tbl-subcategory-selector-fieldvalues=`[$(tbl-filter-mod)$$(tbl-category-selector)$[$(tbl-category-selector-fieldvalues-variable)$]get[$(tbl-subcategory-selector)$]enlist-input[]] +[unique[]]`

The entire code is at this link ----concerned variables are defined using let widget in the line number -118 to 128

Can someone please help to solve this. I tried for many days with no solution yet

First, I need to point out that seven hours was not a long time to wait before this follow-up. (I was personally asleep during those seven hours, for instance.)

But second, this large wall of code in the linked tiddler makes it hard for me to look at, and less likely that I would bother trying. From your description, I really don’t understand what you’re trying to do, and the page, which might be perfectly understandable to your intended user makes little sense to me; I have no medical training. I can’t really tell what you mean by

In short, you’re including too much of one thing (the code) and not enough of another (explanation).

Can you make a substantially simpler demo of the problem and add further explanation of what you’re trying to do?

That was not a follow up. I saw that no one had opened the link of the demo wiki I posted here. So I thought that this post was not getting enough visibility and may go unnoticed like many other similar posts in this forum. The second post was to just increase the visibility.

I understand that there is a large chunk of code used here. That’s why I created a demo wiki. I have mentioned the line number of the exact code concerning the issue.

I will try to explain a little more. This is a dynamic table which shows tiddler fields as columns and each tiddler as rows - just like other dynamic tables.
I tried to add categories to the dynamic table for better understanding and organization - here I add one condition to be satisfied for a tiddler to be included in this category of the dynamic table. This condition is usually a [field-name[field-value]] pair. This part went ok. msk-rad, neuro-rad in the screenshot are the categories in this example which are the field-values in a field called note-subject .

Next I tried to add subcategories to the dynamic table. Again another condition needs to be satisfied for a tiddler to be included in this subcategory of the dynamic table. This condition is again a [field-name[field-value]] pair. text is the subcategory seen in the screenshot which is one of the field-value in a field called note-type. I want to show the category and subcategory headers only if there are any tiddlers satisfying the condition applied under them. But even the categories and subcategories without any tiddlers are shown with my current code. So I thought there must be something wrong with the code where the categories and subcategories are defined using let widget. This is in the line number 118 to 128 of that tiddler - edit the tiddler see the line numbers

Hope this make little more sense. i will add more if still there is any issue in understanding the problem here. It’s fine if it’s still difficult to debug because of the large volume of code involved. I have hesitated in asking this in the forum for the past many days because of the same reason.

I’m afraid I’m still mostly in the dark. I can tell you’re dynamically generating filters. I can’t see much more than that.

Should I be looking for results in dyn-tbl-test? And if so, is this working or non-working code? I simply can’t tell. The only things that seem to do anything dynamic are the list, category-list, card, graph, and tmap buttons, and I do understand that the card and graph ones show a list of tiddlers in different formats. I assume the others do too, but I don’t really get much more than that. Does list work as expected but not category-list?

I can’t tell if your filter generation is not working, or if it’s working as expected but those expected filters are not selecting the expected results, or something else.

Mostly I’m still confused.

I will try to update the demo to make it little more understanding…list category is currently not shown properly since I am working on a different column selector now…

Forgetting both the input and the display UIs, can you simply explain how your categories/subcategories are determined and what the empty ones cover?

I have cleaned up the UI a little bit (with small instructions at each levels) and fixed the list view and added two options in the category-list view - one with sub-categorisation and another without. Take a look at the demo.

List and category-list without sub-categorisations are working . But when I try to subcategorise, all emptymessage of the list widgets are seen at multiple occasions (I have added Nil as emptymessage for the list widget). I want to avoid those subcategories with emptymessage.

I will try to explain what is going wrong with the dynamic table.

    • Above shown is the portion of dynamic table for annotation category (shown in purple header) which was added using the below given select widget.
    • image
    • there are total 3 tiddlers under this category.
  • Now I add a subcategory as note-author as shown below which are in red colour with underline

    • image
    • Now the tiddlers in the annotation category changes as shown below.
    • Only one tiddler is shown where as there are total three which should have been displayed. Also some subcategories are shown which are not actually present in those tiddlers. I want to make sure that those three actual tiddlers are displayed correctly without addition of any subcategories which are not present in the given category.
  • Try this in filter tab of advanced search (which is what the subcategory filter looks like

[note-course[rad]search::[]limit[100]!prefix[$:/state/]note-category[annotation]get[note-author]]
  • The result is three tiddlers only
daniel_gewolb
NicholasZaorsky
arsheth
  • Below given is the variable definition using let widget to dynamically build the filter steps for
tbl-subcategory-selector-fieldvalues=`[$(tbl-filter-mod)$$(tbl-category-selector)$[$(tbl-category-selector-fieldvalues-variable)$]get[$(tbl-subcategory-selector)$]enlist-input[]] +[unique[]]`
  • How can I modify this variable definition so that emptt results of the macro is omitted. Which filter operator is to be used here.