I made a mistake, but this code works:

<$select field='primary'>
<option value='^185'>1850s</option>
<option value='^186'>1860s</option>
<option value='^187'>1870s</option>
<option value='^188'>1880s</option>
</$select>


''year:'' {{!!primary}}<br>
<$count filter="[tag[Company]regexp:charterfiled{!!primary}]"/>

HTH

On Tuesday, May 7, 2019 at 1:54:21 PM UTC-7, Damon Pritchett wrote:
>
> Hi Mark,
>
> That was my very first go at it and it always returns the total count of 
> all Company tiddlers when there should be only anywhere from 4 to 111 
> depending on the decade chosen. The total number is well over 1000. I even 
> tried it with the square brackets while setting the value.
>
> That code I pasted was a copy and paste problem while I was in transition. 
> Sorry about that.
>
> Damon
>
> On Tuesday, May 7, 2019 at 1:36:49 PM UTC-7, Mark S. wrote:
>>
>> Without actually trying it, I can see you've got "charterfiled" in the 
>> value of each option. So the filter is seeing 
>>
>> ...charterfiled<charterfiled[^185]>...
>>
>> Try making your options like:
>>
>> <option value='^185'>1850s</option>
>>
>> Good luck!
>>
>> On Tuesday, May 7, 2019 at 12:57:50 PM UTC-7, Damon Pritchett wrote:
>>>
>>> Hello all,
>>>
>>> I'm a newbie when it comes to filters and such so please bear with me. 
>>>
>>> I have a TW where the tiddlers are companies and each tiddler has a 
>>> field called "charterfiled" for when the company was chartered. The format 
>>> of the charter field is 1864-08-20. I can count how many companies were 
>>> chartered in the 1860s with the following:
>>>
>>> <$count 
>>> filter="[tag[Company]regexp:charterfiled[^186]sortan[charterfiled]]"/>
>>>
>>> What I'm trying to do is to use the select widget to pick the decade I'd 
>>> like. I wrote the following:
>>>
>>> <$select field='primary'>
>>> <option value='charterfiled[^185]'>1850s</option>
>>> <option value='charterfiled[^186]'>1860s</option>
>>> <option value='charterfiled[^187]'>1870s</option>
>>> <option value='charterfiled[^188]'>1880s</option>
>>> </$select>
>>>
>>>
>>> ''year:'' {{!!primary}}<br>
>>> <$count filter="[tag[Company]regexp:charterfiled<primary>]"/>
>>>
>>> The variable "primary" gets set correctly, but the count returns all of 
>>> the tiddlers tagged Company and not just the  ones from the 1860s. What am 
>>> I doing wrong? I've tried many different things in the filter and the count 
>>> will return 0 or the total number, but never the correct number.
>>>
>>> Thanks,
>>>
>>> Damon
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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/5e8215e7-fd0c-45cc-819c-748091466277%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to