I have a container with some notes. Is it possible to show only the names of unique values for an Attribute in the Summary Table using an expression?
No and Yes. Is there button to âjustâ do this? No.
Could you do this with action code, possibly Yes.
But your proposition is ambiguously stated. A table expression reports on the children of the note, but your question implies you want to list all discrete values of a given attribute. What if they occur outside that container. What is the actual intent here?
Also consider the fact that 5â10 values will work fine but in a mature document the list might be 10s or 100s which might mot fi on screen (summary tables donât scroll).
Yes, show discrete values for one attribute of the child notes.
Note 1 - Attribute A - Value Alpha
Note 2 - Attribute A - Value Bravo
Note 3 - Attribute A - Value Charlie
Note 4 - Attribute A - Value Bravo
Note 5 - Attribute A - Value Alpha
Table Summary
Attribute A
Value Alpha
Value Bravo
Value Charlie
HTH explain the ask. If not, let me know.
Sure, there are countless ways to do this.
See the HTML Page template. I included the following action code:
var:set vSet;
vSet=collect(children,$AttributeA);
vSet=vSet.replace(";","<br>");
You then pass the set value to the body with the ^value()^ export code.
Again, there are so many different variations and paths you could go with this. Which variation and path you choose ultimately depends on why and when you need this. Note, the above action code could easily be placed in a stamp, $Rule, or $Edict, as well.
TBX L - Collect Attribute Value from Children.tbx (139.9 KB)
The most common pattern for surfacing values is to use values(). By default it returns all discrete valuesâ for an argument specified attribute. An optional second argument lets you specify a scope as the default is the whole document.
So, values() returns a Set: a lexically sorted list, de-duped (but case sensitiveââAntâ and âantâ are discrete values). That list can made into a value-per-line $Text for review or the text can be exploded into notes. Easier, now we haveâsince v8âthe create() operator, so we can iterate the values() derived list and make a new note per source value.
You do that using the Summary Display Properties pop-over. For instance:
Here, weâve configured 4 columns (each row above is a column in the display). The first 3 columns use attribute values, the fourth column shows that the displayed value can be the result of an action code expression (ideally not a complex oneâĄ).
Tip: You canât place the pop-overâs table cells in edit mode using a cursor click, you must use the Return key. Odd, given you that canât open the dialog using a key. Itâs just one of those quirks. (One I ought to record in aTbRef as it trips me up every time I infrequently use this feature.)
The limited range of table visualisation (colour, font, etc.) is described here: if you want to style the table, Iâd use @satikusalaâs export-based approach above (you donât actually export, but you construct the view as if you were).
Hereâs the file for above: table-demo.tbx (156.7 KB)
As I know (separate conversation) your referenced subject matter is large, I think youâll find that container summary tables will scale badly. If you are looking to chart values of notes in the container, donât overlook container plots.
For the learning stage with the app, my advice would be to read through the section on aTbRef on views and for the view types of interest read all the notes there. If asking yourself, âhow do IâŚ?â or âcan IâŚ?â., then do as above. Make a small TBX, as I just posted, with just enough content to allow you test that feature. In truth itâs a far quicker way of seeing âdoes it?â and if still stuck it generates a more bounded question for the forum.
â . For multi-value attributes (List, Set) each noteâs lost of values is passed into discrete values.
âĄ. Thereâs no limit as such but common sense applies.
@satikusala Thank you for the sample file and the great information!
I watched your video and knew of some of these approaches. However, I was exploring how to display the unique values in the Containerâs Summary Table. So, I wondered if this could be done using Expression value only without a layered solution.
Next time Iâll start with an image like the one below for my post. I thought terms like âSummary Table Expressionâ would lead everyone to exactly where and what I was doing, but that didnât happen.
@mwra Thanks for the fantastic details and numerous references as well! I was working on a response to post from @satikusala when yours came in.
This tripped me us in the beginning as well, but I found a right-click on the text in the Heading or Expression column works as well. So many ways to get there in Tinderbox. Maybe another point for the documentation.
As I stated above, this is what I have been doing but wasnât able to display the unique values as @satikusala did in his report. Essentially, can that output be displayed in the Containerâs Summary Table via expression? If I missed something that gives this answer explicitly let me know.
Attribute A (This is the heading)
Value Alpha (only shown once even though there are two notes in my example)
Value Bravo (only shown once even though there are two notes in my example)
Value Charlie
Also, I appreciate the thoughts and advice around scalability.
I think we got out of sync on âuniqueâ. Iâd interpreted that as a single instance only at output. Here, Iâve adjusted one of the $MyString values in my earlier demo to show the point:
Notes âcowâ and âdogâ have discrete âuniqueâ values, but seen across the values() set of all $MyString values, there are 6 notes with a value for the âMyStringâ attribute but only 5 unique values. Scope for unintentional confusion.
On reflection, my aTbRef illustration is perhaps unintentionally misleading for a new reader as it might imply the table as a mechanism for rich reporting. The little demo file actually gives a truer reflection as to purposeâsummary!
As the table lists all childrenâ and canât be filtered. IOW, you canât control so as to show only the first 5 of N children. You can essentially hide some items by dragging the title/viewport splitter:
Note: doing this you are actually altering $TitleHeight. See more here: Container title height.
another thought re scalability. If you know, due to your contingent research/work information (which varies for each of us), that your number of notes wonât be in the low tens, then when trying out features, ask your self âNow I know how feature X works, would it be useful for 100 items as opposed to 10 items?â. Either way, I think one needs to start by trying a given feature as only once we see how it works can we sensibly ask, âDoes it work for *my data?â. This is where one-size-fits-all answers are difficult (and unintentionally misleading).
â . Regardless of whether they themselves have children. IOW, a scope of children
and not descendants
. This is because we are in the single container scope of a map, albeit reporting the child map of the selected container.
OK, while I remember to do itâŚ
The article on Summary Display Properties pop-over is now updated to reflect the issue of key vs. cursor use for selection/input.
Yes, I was using unique as related to unique values in a data set versus your use of discrete or distinct rows for the table. I want to get the unique values in the data set of all the childrenâs notes in the container without additional layers/steps. e.g., separately building a list/array and getting unique values. Like I said earlier, @satikusala hit the output requirements on the head, except where the output is displayed. So it seems like this last response infers that the answer is no.
Yes, I noticed this through experimentation yesterday. For example, the Table Summary doesnât work well broadly when there are 1800 notes in a container. Not very useful without scroll or large map area. Thus, I thought of learning how to apply filters or get âuniqueâ values as I described above to provide scaleable value. I posted what I thought would be a quick yes or no question, but life sometimes takes you down unexpected paths, especially when communication is involved.
This approach is what I have been doingâsmall tactical projects to explore specific functionality in Tinderbox. First, learn the âArt of the possible,â then assess what I can put in my toolkit and how to apply them to my projects. Admittedly, Iâm also effectively doing a pressure test as part of this process.
Ah, yes. Clearly, you caught some of my myopia, as I donât use summary tabs I kinda glossed over that part of of your request. Thank for the reminder to be more present.
No, my fault, based on some poor assumptions. Next time, Iâll include a picture.
Thanks. The main clarification (for me too) is that âsummaryâ may be misleading here. Rather it is a really more like an outline+column view of the children albeit with the following tweaks:
- the column head name need not be the source attribute name
- the column value can be an action code expression and not just the literal value.
But, the scope of the table is fixed as (all) immediate children of the container and there is no filtering.
Table items are listed in $Sort order
Welcome, I just took that from the inspector âSummary Table Propertiesâ and assumed it was obvious. Turned out, it wasnât.
I wanted to make sure my previous note made sense. You have to right-click directly on the placeholder text, so if you decided to leave it out because people might not easily understand it, that is fine. However, I wanted to make sure you didnât miss it.
Thanks for the clarification. I didnât mention it as I couldnât get that to work. Also the row must be selected before you try to use-right click. Why? I donât know, but years of beta testing have taught me that userâs intuition and developerâs intuition often donât overlap. Thatâs not a slight at either party but a reflection that intuition is more subjective than we imagine and softwareâwhere the software canât reasonably guess intent from input/context aloneâshows this up.
Busy in other stuff now, but noted this for adding the the pop-over article IDC.
Meh - done. See Summary Display Properties pop-over.
I still think the input is over keyboard-centric. An overlooked aspect is that some people are very keyboard centric, others the reverse. All sorts of issues, not least disabilities, play into that. Designing for one, not both can result in confusion.
Before this recent exchange Iâd already made a feature request for double-click on a cell (regardless of current row/cell selection or edit mode). That seems a far better match to general observed behaviour (though it might conflict with style guides). The logic is, double-click the thing with which you wish to interact // if a cell is currently in edit mode, close that edit and open the double-clicked one. That description is not to be disrespectful to the developer, who in this app puts a lot of unseen thought into the UI. However, I think because few of us fluidly both key-first and cursor-first its hard to remember the mode we donât use. Testing should capture this assuming both behaviour types are testing. In a toolbox there are a lot of âtoolâ combinations. Plus itâs hard to properly test a feature to which one has no personal attachment (as likely we test them how we imagined they are used (e.g. from initial rough design notes) as opposed to how they are actually used). No foul there, just the complexity of testing unexpectedly complex things.