Hi Tony,

That's amazing. I feel like someone has just pointed out an exception to 
the law of gravity or something. I've obviously underestimated the power of 
wikify. Have to look and see if it can be modified for Dave's case.

-- Mark

On Monday, August 6, 2018 at 10:09:43 PM UTC-7, TonyM wrote:
>
> Folks,
>
> I found a method to sort a set of items by a count result which is only 
> found within a loop. Using my previously posted data, I believe it can be 
> adapted for the problem at hand.
>
> It assumes the fruit do not have spaces in their name which would be true 
> if this is extracted from fieldnames.
>
> The sort-me generates a list with the count as the prefix, and <<sort-me>> 
> is used to create a filter that is then sorted in reverse numerical order.
>
> \define sort-me()
> <$list filter="[all[]tag[fruit]!sort[]]" variable=fruit>
>   <$list filter="[tag<fruit>count[]]" variable=num>
>   <<num>>-<<fruit>>
>   </$list>
> </$list>
> \end
> <$wikify name=sort-filter text="<<sort-me>> +[!nsort[]]">
> <$list filter=<<sort-filter>> >
>
>
> </$list>
> </$wikify>
>
> The Result is 
>
> 4-Apple <https://tiddlywiki.com/prerelease/#4-Apple>
> 3-Orange <https://tiddlywiki.com/prerelease/#3-Orange>
> 1-Mango <https://tiddlywiki.com/prerelease/#1-Mango>
>
>
> Of course this could be displayed as text or non-links and possibly 
> divided back into the number and fruit name.
>
> Regards
> Tony
>
> On Tuesday, August 7, 2018 at 12:28:40 PM UTC+10, TonyM wrote:
>>
>> Here is a Small test data set of fruits and varieties attached.
>>
>> With the tiddler Fruit lists
>> containing the question
>>
>> Regards
>> Tony
>>
>> On Saturday, August 4, 2018 at 5:40:52 AM UTC+10, Dave wrote:
>>>
>>> Is there a way to sort the results of a filter by frequency of most 
>>> common to single instance?
>>>
>>> E.g. let's say a filter puts out the following:
>>>
>>> Apple pear Orange
>>> Pear 
>>> Orange banana
>>> Orange grapefruit
>>>
>>> How would you filter it further to result with something like this:
>>>
>>> Orange 3
>>> Pear 2
>>> Apple 
>>> banana
>>> Grapefruit
>>>
>>> Thanks,
>>> - Dave
>>>
>>>

-- 
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/88f9283e-01b2-4e11-a558-d65fd681fc80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to