Your data is considerably more complex than the simple fruit example. In 
particular, each origin is it's own thing, not a tiddler. So it can't be 
counted without making it unique first because TW will flatten a series of 
input titles that are the same. It also took two wikified set plus one 
outer wikified set plus the data retrieved from "origin" had to be remarked 
as tiddler names/links because the wikify widget flattens that (that is 
"opp motor cortex" appears as 3 items.). A regular expression was then 
needed to look for uniquified (new word) entries and pull them out. If you 
start using "@" in your data that will throw the system off because that's 
what I used to create the unique titles.

After all that, the data is not listed as opp (3)  but as 3-opp. I think a 
couple of inner loops might be able convert that, but it would be a lot 
easier with a string regular expression filter.

Have fun
-- Mark

\define cat-origin-link() <$text text="[[$(origin)$]]"/>
\define get-origins-list()
<$list filter="[all[current]fields[]]" variable="fieldname">
<$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" variable=
"dummy" >
<$list filter="[title<fieldname>getindex[origin]]" variable="originlist">
<$list filter=<<originlist>> variable="origin">
<<cat-origin-link>>
</$list>
</$list>
</$list>
</$list>
\end
\define cat-origin-uniq-link() <$text text="[[$(fieldname)$@$(origin)$@]]"/>
\define get-origins-list-uniquified()
<$list filter="[all[current]fields[]]" variable="fieldname">
<$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" variable=
"dummy" >
<$list filter="[title<fieldname>getindex[origin]]" variable="originlist">
<$list filter=<<originlist>> variable="origin">
<<cat-origin-uniq-link>>
</$list>
</$list>
</$list>
</$list>
\end
\define cat-count-origin() <$text text="[[$(count)$-$(origin)$]]"/>
\define get-wikified-counts()
<$wikify  text="<<get-origins-list>>" name="list-filter">
<$list filter=<<list-filter>> variable=origin>
<$wikify name="count-filter" text="<<get-origins-list-uniquified>> 
+[regexp[.*@<<origin>>@$]count[]]">
<$list filter=<<count-filter>> variable=count>
<<cat-count-origin>>
</$list>
</$wikify>
</$list>
</$wikify>
\end

! ORIGIN COUNTS

<$wikify text="<<get-wikified-counts>> +[nsort[]]" name="filter-counts">
<$list filter=<<filter-counts>> variable="count-origin">
<<count-origin>><br/>
</$list>
</$wikify>



-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f08aec6d-474d-4f1c-a913-cdef2c49a7d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to