As long as the car names do not have spaces, this works: <$list filter="[get[car]split[ ]each:value[]sort[]]" variable="car"> <<car>>: <$count filter="[all[tiddlers]contains:car<car>]"/><br/> </$list>
On Tuesday, October 22, 2019 at 11:24:23 AM UTC-7, Mohammad wrote: > > Well yes, > there is no and! The field contains only the name of car makers so the > correct values are like these > Toyota BMW > Ford Toyota > > but we don't know their name in advance. > > > > On Tuesday, October 22, 2019 at 8:09:42 PM UTC+3:30, Mark S. wrote: >> >> At this point it is more complicated, and we need to consider the >> structure of the data. Will the field >> literally contain "Toyota *and* BMW.", in which case the car with the >> highest count will probably >> be the "and" car. Or will it be a list field of some type? Or will we >> know the names of car makes in >> advance? >> >> On Tuesday, October 22, 2019 at 8:21:33 AM UTC-7, Mohammad wrote: >>> >>> Hi Mark, >>> Thanks it works! >>> I assume the input is all[tiddlers+shadows]. >>> >>> One more question if in a field there is *Toyota and BMW* >>> Then how modify the above code to cover such a case? >>> >>> --Mohammad >>> >>> On Tuesday, October 22, 2019 at 6:17:51 PM UTC+3:30, Mark S. wrote: >>>> >>>> <$list filter="[each[car]get[car]]"> >>>> <<currentTiddler>>: <$count filter="[car<currentTiddler>]"/><br/> >>>> </$list> >>>> >>>> On Tuesday, October 22, 2019 at 4:51:08 AM UTC-7, Mohammad wrote: >>>>> >>>>> This may be a repeated question >>>>> >>>>> Assume you have few tiddlers some have field called *car* >>>>> >>>>> Then you want to count how many cars of each makers is referenced >>>>> >>>>> Example >>>>> Tid01 >>>>> car: Toyota >>>>> Tid02 >>>>> car: Fiat >>>>> Tid03 >>>>> car: BMW >>>>> Tid04 >>>>> car: Toyota >>>>> Tid05 >>>>> car: BMW >>>>> Tid06 >>>>> car: Ford >>>>> Tid07 >>>>> car: Toyota >>>>> Tid08 >>>>> car: BMW >>>>> Tid09 >>>>> car: Ford >>>>> Tid10 >>>>> car: Toyota >>>>> >>>>> Answer should be >>>>> BMW: 3 >>>>> Fiat: 1 >>>>> Ford: 2 >>>>> Toyota: 4 >>>>> >>>>> >>>>> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c350eb5b-1d81-4687-87f4-aa85801e5cdf%40googlegroups.com.

