Re: [tw5] Re: How to sort a list by multiple fields (and put it in a table)?

2022-04-16 Thread Harry Reid
Hi Mark,

Thanks for the help! I tried to copy your code, but it gives a syntax error
notice. All my fields used for sorting are numerical values, do I still
need to treat them as string in the code? (e.g. 1960.02 for birth_year, 50
for rank)

What I have now is

```
<$list
filter="[c_status[incumbent]:sort:number[[rank]addsuffix[birth_year]]]">
<$link to=<>><$view field=birth_year/><$view
field=title/><$view field=rank/>



or
```
<$list
filter="[c_status[incumbent]:sort:string:caseinsensitive[[rank]addsuffix[birth_year]]">
<$link to=<>><$view field=birth_year/><$view
field=title/><$view field=rank/>

```

Neither code seems to work and I'm having some difficulty in reading
through the SFRP document. Would anyone mind helping me to look more into
this? Many thanks!

'Mark S.' via TiddlyWiki  于2022年4月16日周六
10:00写道:

> To sort by multiple fields, you would use the sort filter run prefix
> .(SFRP) Inside the
> SFRP, you would use a filter perhaps like:
>
> ```
>
> :sort:string:caseinsensitive[[c_rank]addsuffix[tenure]addsuffix[birth_year]]
> ```
>
> which would sort by rank, tenure, and birth year. You might need to
> zero-pad your fields.
>
> To create the table, the easiest way is to use standard HTML notation.
>
>
>
> On Friday, April 15, 2022 at 2:09:56 PM UTC-7 Harry wrote:
>
>> Hi,
>>
>> I have a question about sort a list by multiple fields. I have a bunch of
>> entries of persons' bios. Each bio entry has a set of fields associated,
>> such as birth year, death year, birth date, tenure length etc.
>>
>> I want to create a list with some of those persons and sort it by
>> multiple fields, such as first by tenure length, if same tenure, then sort
>> by birth year, then death year etc.
>>
>> What I currently have is
>>
>> <$list filter="[c_status[incumbent]sort[c_rank]]">
>> 
>>
>> This gives me a list that allows me to filter all incumbents but the list
>> can only be sorted by rank. I want to add multiple fields (e.g. V1, V2, V3)
>> behind the rank sort but it doesn't work. I'd appreciate it if any one
>> could share their insights on this.
>>
>> My second, maybe more unrealistic goal, is to transform the list to a
>> table. Its visual would ideally look like this (
>> https://en.wikipedia.org/wiki/Lists_of_state_leaders_by_age#Top_ten_since_1942),
>> i.e. I can put each field value of one entry in different cells of the same
>> row and the table will update itself
>>
>> The code I'm currently using is
>>
>> <$list filter="[c_status[incumbent]sort[c_rank]]">
>> <$link to=<>><$view field=birth_year/><$view
>> field=title/><$view field=birth_month/><$view field=c_rank/>
>>
>> And the layout is a list of sorted entries with field values crudely
>> attached at the beginning and the end of each line. Basically I wonder if I
>> can separate those values into different cells.
>>
>> Many thanks!
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/3DjVJRjEvxU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/5595838a-ac78-4702-a6ec-9a8d4bcbn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAKbFfDkeG7kR40c-ZuTfxtSfJf4niwW6NbPqgM5fWJLzZB_tMQ%40mail.gmail.com.


Re: [tw5] Re: How to create a table that updates each cell entry as tiddlers change?

2021-07-24 Thread Harry Reid
Hi Tones,

Thanks for your reminder! I have looked into the dynamic table but it seems
that it does not allow me to customize the headers of columns and rows.
Following your lead, I have tried to use list-links, but am still hitting
some roadblocks. The code I'm currently trying is :
| !Committee | !Chair |
| !Agriculture | <> |

27341089 is a unique code I assign for agriculture chair, so when a new
chair takes place, I'll update the relevant tiddler with the fields to make
sure they auto-update in the table. However, the layout has a dot (see the
attached pic, yellow shaded). Is there anyway that I can tweak the macro to
remove the dot? Or should I try some different routes? Thanks a million!

Best
Harry


TW Tones  于2021年7月23日周五 下午8:08写道:

> Harry,
>
> There are arrange of approaches you can use here. There are already *dynamic
> table* solutions or the content of your table can refer to variables or
> transclusion such that if they change it is reflected in your table. I tend
> to populate tables using the list widget so its the result of the list that
> finds the content even when it changes.
>
> Using your example the table cell could contain {{senate agriculture
> committee!! incumbent_chair}} which means it can be nothing but the value
> there in.
>
> Regards
> Tones
> On Saturday, 24 July 2021 at 09:08:25 UTC+10 Harry wrote:
>
>> Hi all,
>>
>> I have a niche question about creating an auto-updating table and wonder
>> if anyone can give me some guidance.
>>
>> To illustrate the specific context, let's say I'm trying to create a
>> table of all chairs and ranking memebers of the senate committees. The
>> table would look like this:
>> | Committee | Chair | Ranking Member|
>> | Agriculture | 1 | 2 |
>> | Armed Service | 3 | 4 |
>>
>> When the agriculture chair changes from “Jane Doe (FL)” to "John Smith",
>> I have to manually change the code entry of cell 1 from "[[Jane Doe|Jane
>> Doe (FL)]],,D,," to "John Smith,,R,,".
>>
>> Instead of manually putting codes into cells 1 through 4, I wonder if
>> there is a way that the table could update itself, since the chairs and
>> ranking members change from time to time.
>>
>> What I'm currently exploring is to creat two fields in each committee's
>> tiddler. Say for tiddler "senate agriculture committee", I creat two fields
>> "incumbent_chair" and "incumbent_ranking". My hope is that there can be
>> some way that links cell 1 with the "incumbent_chair", so that whenever I
>> change the "incumbent_chair" field, cell 1 in the table above would
>> automatically update itself (with all the formatting noted above). So far
>> this is not working out, and the best I can do now is to use "<$view
>> tiddler= field=/>" which only allows the table to update cell 1 as the text
>> of the field, not as a tiddler that can be clicked and redirected, nor can
>> I add specific formatting as mentioned in the example above.
>>
>> Is there anyway that I can write a code to reflect this need? Very much
>> appreciate all the help!
>>
>>
>> Best
>>
>> Harry
>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/wE7dVR_oBnc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/d5f15b6e-5496-4517-8392-a0fd8c8903c7n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAKbFfDkzentrVJ%3Dp-6Ob-8410xvqZyvdWqViw_MZZDH6G%2B8c2g%40mail.gmail.com.


Re: [tw5] Re: How to link a tag to a tiddler of a different name?

2021-07-24 Thread Harry Reid
Thanks a lot, Tones! Hope your test end up fine.

Best
Harry

TW Tones  于2021年7月24日周六 上午9:20写道:

> Harry,
>
> I will have a look tomorrow, after I get in a Queue for a covid test,
> since an employee at my local supermarket has tested positive when I was
> there. If you don't hear from me feel free to send a private message.
>
> Of course anyone else can help Harry.
>
> Tones
>
> On Saturday, 24 July 2021 at 13:13:14 UTC+10 Harry wrote:
>
>> Hi Tones,
>>
>> Thanks for your help. I think what you suggested is what I want. I don't
>> mean to skip the tag pill dropdown, but want to make the first click after
>> the dropdown to be redirected to a different tiddler, (See the blue shaded
>> line in the pic attached). If there's a way to do so, I would really
>> appreciate your help with the specific steps on coding (I'm extremely
>> novice to this), thanks again!
>>
>> Best
>> Harry
>>
>> 在2021年7月23日星期五 UTC-4 下午9:43:36 写道:
>>
>>> Harry,
>>>
>>> It would not be wise to do it on the first click of the tag as access to
>>> the tag pill dropdown is important.
>>>
>>> I have a small set of macros that extend the "tag pill dropdown". I
>>> could make a variation that looks for say a "redirect" field in a "tag
>>> tiddler" and displays that in the "tag pill dropdown" for which a click
>>> would open the tiddler.
>>>
>>> Perhaps the redirect field like this [[Congressional Black Caucus|List
>>> of all *C*ongressional *B*lack *C*aucus members]]
>>>
>>> So for the CBC tag click, and you will see "Congressional Black Caucus"
>>> and a click would navigate to [[List of all *C*ongressional *B*lack *C*aucus
>>> members]]
>>>
>>> What do you think?
>>>
>>> Tones
>>>
>>>
>>> On Saturday, 24 July 2021 at 10:52:25 UTC+10 Harry wrote:
>>>
 Hi Tones,

 Thanks for your help. This is certainly an easy solution. Though in my
 case, I have a few dozens of such tags with short acronyms but longer full
 names. So I wonder if there's another way that could allow a click on the
 tag tiddler to be auto-redirected to another tiddler. This would save a
 click and also help me not opening too many tiddlers after clicking on
 these tags. If it's too much hassle, then never mind, thanks again!

 Best
 Harry

 在2021年7月23日星期五 UTC-4 下午8:02:52 写道:

> Harry,
>
> In this case the tiddler CBC is a tiddler for the tag. The quick
> solution is to place in CBC [[List of all congressional black caucus
> members]] and perhaps also <> Even add "List of all 
> *C*ongressional
> *B*lack *C*aucus members (CBC)."
>
> If someone is familiar that CBC is a tag they can make use of the tag
> to add items or reorder with tag pill. If they do not understand what CBC
> is about then by opening the "tag tiddler" they see a link to its tiddler
> or expanded name.
>
> Of course we could automate and doo more but I am not sure it would
> occur often enough to bother.
>
> Regards
> Tones
>
>
> On Saturday, 24 July 2021 at 09:39:39 UTC+10 Harry wrote:
>
>> Hi all,
>>
>> I have a question that I think might be simple but have not been able
>> to figure out as a novice. I have attached a tag, say "CBC", to all 
>> entries
>> who are a member of the congressional black caucus. When I click the CBC
>> tag in a given tiddler, the pop-out would show a clickable line "CBC" 
>> which
>> would automatically redirect to an yet-uncreated entry "CBC" . But I
>> already have a list tiddler named "List of all congressional black caucus
>> members" and I want to make the clickable line "CBC" redirected to this
>> longer-named tiddler. Is there a simple way that I can do it? Thanks a 
>> lot!
>>
>> Best
>> Harry
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/-hIdxL3nv-Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/8b0838e9-33ce-4df8-8aac-1c92b227a271n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAKbFfDmt17OXv4X0pW7aYz4ngBQqdJ%2BnA3k_pOhX6R-Nq%2BLf-g%40mail.gmail.com.