What's the best practice for repeated table

Let me try to explain what I’m trying to do:

  • I have several set of data linked to a date (for a given date, it can have to up to 50 different data), as an example:
                                      date1      date 2  ...
class 1
      sub class 2
            sub class 3 
                         data 1       12.5      25.3     
            sub class 4
                         data 2       .02        .04
...

the subclass can be up to 5 levels and the data can be up to 50, which means for each data, I’ll have 1 date and 1 number associate to it, so there will be a lot of “repeated” date for each number, what’s the best practice to solve this? I was thinking in using table, then I’ll have a lot of duplicate date, if I setup a variable, each number will have to reference to the date variable, which I guess won’t solve my problem (which is to avoid repetition).
ps:

  1. I’m new to TW, not sure if I set it up correctly, I think I’ve added Shiraz dynamic table, but can’t figure out how to use it, can someone please take a look at my file and check if I missed something?
  2. sorry, my English is not that good, so if there’s something not clear, please let me know and I’ll try to explain it better.
1 Like

HI @michael
have another look at phrdemo.tiddlyhost.com
I have changed the table and added buttons for new records.
It looks as if you have Shiraz plugin installed.
If you open 2 browser windows, one with your file and the other with mine, you can drag files between the windows.
Add the tiddlers below to your file by saving them and then importing them into your file (e.g. Drag them from your downloads folder into the wiki at the top of the tiddler
tiddlers.json (1.4 KB)
Blood 2021-11-24 18 29 18.json (328 Bytes)
Blood 2021-11-24 18 29 18 1.json (444 Bytes)
Laboratory Results (All).json (682 Bytes)

ScotConfig.json (189 Bytes)
My Templates.json (247 Bytes)
Buttons.json (189 Bytes)
$ __michael_Tiddler Type Macro.json (620 Bytes)
Urine 2021-11-24 18 22 31.json (301 Bytes)

Hi @Scot,

I just noticed your dynamic table overflows in x direction.

For example see: Personal Health Record — a web notebook

Use the below script instead

<div style="overflow-x:auto;width:100%">
Filter and search in table <$edit-text tiddler="$:/temp/demo/dtable/search" field=text tag=input default=""/> <$button set="$:/temp/demo/dtable/search" setTo="" tooltip="clear searchbox">x</$button>
<$macrocall $name=table-dynamic filter="[tag[PHR]sort[title]search{$:/temp/demo/dtable/search}]" class="w-100" fields="tbl-expand title TestType Sub_Type TestDate Cholestrol Glucose Density pH"  caption="''Table 1. Laboratory Results with search box''" stateTiddler="20200213/0928"/>

</div>

The difference is wrapping the table in a div with overflow-x:auto;

<div style="overflow-x:auto;width:100%">
...
</div>

@Scot thanks, downloaded it and I can update it. I’ll take a look, thanks again.

Thank you @Mohammad
As I have your attention, can you tell me why I can’t search for say, Lipid.
Is It something I have done wrong, I thought all fields were searchable?

@Scot Call the table-dynamic as below! I think there is no need to use sort here! I removed it!
Your question does not related to tables, it is related to search op.

<$macrocall $name=table-dynamic filter="[tag[PHR]search:*{$:/temp/demo/dtable/search}]" class="w-100" fields="tbl-expand title TestType Sub_Type TestDate Cholestrol Glucose Density pH"  caption="''Table 1. Laboratory Results with search box''" stateTiddler="20200213/0928"/>

Note to the search:* means search all fields!

Thank you @Mohammad
I didn’t realise that there was a search all * method
If there is anything else that I have overlooked please let me know.