[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Thank you, sir. You are a gentleman and a scholar, sir. Damon On Wednesday, May 8, 2019 at 12:32:27 PM UTC-7, Mark S. wrote: > > If you don't mind having every single year in your drop-down, then change > the range to range[1781,1979] or whatever your years are. Also get rid of > "0s" since it's no longer relevant. > > On Wednesday, May 8, 2019 at 12:07:30 PM UTC-7, Damon Pritchett wrote: >> >> Thanks Mark, >> >> That works for the decades. How would I modify that to add the individual >> years as well as the decades? By the way, I really appreciate the help. I >> obviously need it. >> >> Damon >> >> >> On Wednesday, May 8, 2019 at 11:21:02 AM UTC-7, Mark S. wrote: >>> >>> It's a little more complicated. You can generate like this: >>> >>> \define regxdate() ^$(prefix)$ >>> >>> <$select field='primary'> >>> <$list filter="[range[185,188]]" variable="prefix"> >>> >><>0s >>> >>> >>> >>> The macro goes at the top of the tiddler. You can use the "multiple" and >>> "size" options to put the list in its own box. The only problem is that >>> your user could accidentally pick more than one item at a time. >>> There might be a way to fix that by over-riding the class. >>> >>> HTH >>> >>> >>> On Wednesday, May 8, 2019 at 10:58:08 AM UTC-7, Damon Pritchett wrote: Oh ok. That makes sense. Thanks. One more question. If I wanted to make it so I can select any given year or a decade, is there a way I can do that without having to type in all of the selections? Such as some kind of loop or similar? Also, I would anticipate that the dropdown would get very large in that case. Is there a way to make a scrollable dropdown? Thanks again, Damon On Wednesday, May 8, 2019 at 10:48:29 AM UTC-7, Mark S. wrote: > > Well, the select widget has to store its results somewhere. However, > you can specify some other tiddler in the select widget (e.g. <$select > tiddler="SomeOtherTiddler"...> ) > > You would then have to refer to it in your count widget > > <$count > filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> > > On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: >> >> Ok - now for another question. How can I modify this to make it use a >> variable instead of a field so that the tiddler isn't changed? >> >> Thanks >> >> Damon >> >> >> On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: >>> >>> Thanks to all. I thought I had tried that, but apparently I was >>> changing too many things at once and didn't find the right one. >>> >>> Damon >>> >>> On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - I made a mistake, but this code works: <$select field='primary'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$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... >> >> Try making your options like: >> >> 1850s >> >> 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
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
If you don't mind having every single year in your drop-down, then change the range to range[1781,1979] or whatever your years are. Also get rid of "0s" since it's no longer relevant. On Wednesday, May 8, 2019 at 12:07:30 PM UTC-7, Damon Pritchett wrote: > > Thanks Mark, > > That works for the decades. How would I modify that to add the individual > years as well as the decades? By the way, I really appreciate the help. I > obviously need it. > > Damon > > > On Wednesday, May 8, 2019 at 11:21:02 AM UTC-7, Mark S. wrote: >> >> It's a little more complicated. You can generate like this: >> >> \define regxdate() ^$(prefix)$ >> >> <$select field='primary'> >> <$list filter="[range[185,188]]" variable="prefix"> >> >><>0s >> >> >> >> The macro goes at the top of the tiddler. You can use the "multiple" and >> "size" options to put the list in its own box. The only problem is that >> your user could accidentally pick more than one item at a time. >> There might be a way to fix that by over-riding the class. >> >> HTH >> >> >> On Wednesday, May 8, 2019 at 10:58:08 AM UTC-7, Damon Pritchett wrote: >>> >>> Oh ok. That makes sense. Thanks. >>> >>> One more question. If I wanted to make it so I can select any given year >>> or a decade, is there a way I can do that without having to type in all of >>> the selections? Such as some kind of loop or similar? Also, I would >>> anticipate that the dropdown would get very large in that case. Is there a >>> way to make a scrollable dropdown? >>> >>> Thanks again, >>> >>> Damon >>> >>> >>> On Wednesday, May 8, 2019 at 10:48:29 AM UTC-7, Mark S. wrote: Well, the select widget has to store its results somewhere. However, you can specify some other tiddler in the select widget (e.g. <$select tiddler="SomeOtherTiddler"...> ) You would then have to refer to it in your count widget <$count filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: > > Ok - now for another question. How can I modify this to make it use a > variable instead of a field so that the tiddler isn't changed? > > Thanks > > Damon > > > On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: >> >> Thanks to all. I thought I had tried that, but apparently I was >> changing too many things at once and didn't find the right one. >> >> Damon >> >> On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - >>> >>> I made a mistake, but this code works: >>> >>> <$select field='primary'> >>> 1850s >>> 1860s >>> 1870s >>> 1880s >>> >>> >>> >>> ''year:'' {{!!primary}} >>> <$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... > > Try making your options like: > > 1850s > > 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'> >> 1850s >> 1860s >> 1870s >> 1880s >> >> >> >> ''year:'' {{!!primary}} >> <$count filter="[tag[Company]regexp:charterfiled]"/> >> >> The variable "primary" gets set correctl
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Thanks Mark, That works for the decades. How would I modify that to add the individual years as well as the decades? By the way, I really appreciate the help. I obviously need it. Damon On Wednesday, May 8, 2019 at 11:21:02 AM UTC-7, Mark S. wrote: > > It's a little more complicated. You can generate like this: > > \define regxdate() ^$(prefix)$ > > <$select field='primary'> > <$list filter="[range[185,188]]" variable="prefix"> > >><>0s > > > > The macro goes at the top of the tiddler. You can use the "multiple" and > "size" options to put the list in its own box. The only problem is that > your user could accidentally pick more than one item at a time. > There might be a way to fix that by over-riding the class. > > HTH > > > On Wednesday, May 8, 2019 at 10:58:08 AM UTC-7, Damon Pritchett wrote: >> >> Oh ok. That makes sense. Thanks. >> >> One more question. If I wanted to make it so I can select any given year >> or a decade, is there a way I can do that without having to type in all of >> the selections? Such as some kind of loop or similar? Also, I would >> anticipate that the dropdown would get very large in that case. Is there a >> way to make a scrollable dropdown? >> >> Thanks again, >> >> Damon >> >> >> On Wednesday, May 8, 2019 at 10:48:29 AM UTC-7, Mark S. wrote: >>> >>> Well, the select widget has to store its results somewhere. However, you >>> can specify some other tiddler in the select widget (e.g. <$select >>> tiddler="SomeOtherTiddler"...> ) >>> >>> You would then have to refer to it in your count widget >>> >>> <$count >>> filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> >>> >>> On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: Ok - now for another question. How can I modify this to make it use a variable instead of a field so that the tiddler isn't changed? Thanks Damon On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: > > Thanks to all. I thought I had tried that, but apparently I was > changing too many things at once and didn't find the right one. > > Damon > > On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - >> >> I made a mistake, but this code works: >> >> <$select field='primary'> >> 1850s >> 1860s >> 1870s >> 1880s >> >> >> >> ''year:'' {{!!primary}} >> <$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... Try making your options like: 1850s 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'> > 1850s > 1860s > 1870s > 1880s > > > > ''year:'' {{!!primary}} > <$count filter="[tag[Company]regexp:charterfiled]"/> > > 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 > > > > > > >
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
It's a little more complicated. You can generate like this: \define regxdate() ^$(prefix)$ <$select field='primary'> <$list filter="[range[185,188]]" variable="prefix"> >><>0s The macro goes at the top of the tiddler. You can use the "multiple" and "size" options to put the list in its own box. The only problem is that your user could accidentally pick more than one item at a time. There might be a way to fix that by over-riding the class. HTH On Wednesday, May 8, 2019 at 10:58:08 AM UTC-7, Damon Pritchett wrote: > > Oh ok. That makes sense. Thanks. > > One more question. If I wanted to make it so I can select any given year > or a decade, is there a way I can do that without having to type in all of > the selections? Such as some kind of loop or similar? Also, I would > anticipate that the dropdown would get very large in that case. Is there a > way to make a scrollable dropdown? > > Thanks again, > > Damon > > > On Wednesday, May 8, 2019 at 10:48:29 AM UTC-7, Mark S. wrote: >> >> Well, the select widget has to store its results somewhere. However, you >> can specify some other tiddler in the select widget (e.g. <$select >> tiddler="SomeOtherTiddler"...> ) >> >> You would then have to refer to it in your count widget >> >> <$count >> filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> >> >> On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: >>> >>> Ok - now for another question. How can I modify this to make it use a >>> variable instead of a field so that the tiddler isn't changed? >>> >>> Thanks >>> >>> Damon >>> >>> >>> On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: Thanks to all. I thought I had tried that, but apparently I was changing too many things at once and didn't find the right one. Damon On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - > > I made a mistake, but this code works: > > <$select field='primary'> > 1850s > 1860s > 1870s > 1880s > > > > ''year:'' {{!!primary}} > <$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... >>> >>> Try making your options like: >>> >>> 1850s >>> >>> 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'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$count filter="[tag[Company]regexp:charterfiled]"/> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Oh ok. That makes sense. Thanks. One more question. If I wanted to make it so I can select any given year or a decade, is there a way I can do that without having to type in all of the selections? Such as some kind of loop or similar? Also, I would anticipate that the dropdown would get very large in that case. Is there a way to make a scrollable dropdown? Thanks again, Damon On Wednesday, May 8, 2019 at 10:48:29 AM UTC-7, Mark S. wrote: > > Well, the select widget has to store its results somewhere. However, you > can specify some other tiddler in the select widget (e.g. <$select > tiddler="SomeOtherTiddler"...> ) > > You would then have to refer to it in your count widget > > <$count > filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> > > On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: >> >> Ok - now for another question. How can I modify this to make it use a >> variable instead of a field so that the tiddler isn't changed? >> >> Thanks >> >> Damon >> >> >> On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: >>> >>> Thanks to all. I thought I had tried that, but apparently I was changing >>> too many things at once and didn't find the right one. >>> >>> Damon >>> >>> On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - I made a mistake, but this code works: <$select field='primary'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$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... >> >> Try making your options like: >> >> 1850s >> >> 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'> >>> 1850s >>> 1860s >>> 1870s >>> 1880s >>> >>> >>> >>> ''year:'' {{!!primary}} >>> <$count filter="[tag[Company]regexp:charterfiled]"/> >>> >>> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/98eb439e-ba4a-4a0c-8d88-1aee405c1a65%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Well, the select widget has to store its results somewhere. However, you can specify some other tiddler in the select widget (e.g. <$select tiddler="SomeOtherTiddler"...> ) You would then have to refer to it in your count widget <$count filter="[tag[Company]regexp:charterfiled{SomeOtherTiddler!!primary}]"/> On Wednesday, May 8, 2019 at 10:36:26 AM UTC-7, Damon Pritchett wrote: > > Ok - now for another question. How can I modify this to make it use a > variable instead of a field so that the tiddler isn't changed? > > Thanks > > Damon > > > On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: >> >> Thanks to all. I thought I had tried that, but apparently I was changing >> too many things at once and didn't find the right one. >> >> Damon >> >> On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - >>> >>> I made a mistake, but this code works: >>> >>> <$select field='primary'> >>> 1850s >>> 1860s >>> 1870s >>> 1880s >>> >>> >>> >>> ''year:'' {{!!primary}} >>> <$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... > > Try making your options like: > > 1850s > > 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'> >> 1850s >> 1860s >> 1870s >> 1880s >> >> >> >> ''year:'' {{!!primary}} >> <$count filter="[tag[Company]regexp:charterfiled]"/> >> >> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/4738148e-da09-4c0c-96af-bd155289e11a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Ok - now for another question. How can I modify this to make it use a variable instead of a field so that the tiddler isn't changed? Thanks Damon On Tuesday, May 7, 2019 at 4:13:25 PM UTC-7, Damon Pritchett wrote: > > Thanks to all. I thought I had tried that, but apparently I was changing > too many things at once and didn't find the right one. > > Damon > > On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote:Ok - >> >> I made a mistake, but this code works: >> >> <$select field='primary'> >> 1850s >> 1860s >> 1870s >> 1880s >> >> >> >> ''year:'' {{!!primary}} >> <$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... Try making your options like: 1850s 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'> > 1850s > 1860s > 1870s > 1880s > > > > ''year:'' {{!!primary}} > <$count filter="[tag[Company]regexp:charterfiled]"/> > > 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/966c0695-734a-4dc6-9926-362a016a3b1b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Thanks to all. I thought I had tried that, but apparently I was changing too many things at once and didn't find the right one. Damon On Tuesday, May 7, 2019 at 3:36:39 PM UTC-7, Mark S. wrote: > > I made a mistake, but this code works: > > <$select field='primary'> > 1850s > 1860s > 1870s > 1880s > > > > ''year:'' {{!!primary}} > <$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... >>> >>> Try making your options like: >>> >>> 1850s >>> >>> 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'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$count filter="[tag[Company]regexp:charterfiled]"/> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/5190da4f-2884-46be-967a-7b28562896df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
I made a mistake, but this code works: <$select field='primary'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$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... >> >> Try making your options like: >> >> 1850s >> >> 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'> >>> 1850s >>> 1860s >>> 1870s >>> 1880s >>> >>> >>> >>> ''year:'' {{!!primary}} >>> <$count filter="[tag[Company]regexp:charterfiled]"/> >>> >>> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
On Tuesday, May 7, 2019 at 12:57:50 PM UTC-7, Damon Pritchett wrote: > > 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'> > 1850s > 1860s > 1870s > 1880s > > ''year:'' {{!!primary}} > <$count filter="[tag[Company]regexp:charterfiled]"/> > 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. > The problem is that the "primary" value is being stored in the current tiddler, but when you are referencing it in the filter, it is relative to each matched [tag[Company]] tiddler. Also, the filter syntax, "" is references a variable, not a field. Thus, to actually refer to the selected value stored in the *current* tiddler, try this: <$select field='primary'> 1850s 1860s 1870s 1880s ''year:'' {{!!primary}} <$vars primary={{!!primary}}> <$count filter="[tag[Company]regexp:charterfiled]"/> Let me know how it goes... enjoy, -e Eric Shulman TiddlyTools.com: "Small Tools for Big Ideas!" (tm) InsideTiddlyWiki: The Missing Manuals -- 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 post to this group, send email to tiddlywiki@googlegroups.com. 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/c6f3ef9a-0f5f-469e-b1eb-06168af190f5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
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... > > Try making your options like: > > 1850s > > 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'> >> 1850s >> 1860s >> 1870s >> 1880s >> >> >> >> ''year:'' {{!!primary}} >> <$count filter="[tag[Company]regexp:charterfiled]"/> >> >> 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/0f6891ba-2ab8-44ed-b844-1da25efb2bcf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw5] Re: Generate list of tiddlers based on a partial field match with variables
Without actually trying it, I can see you've got "charterfiled" in the value of each option. So the filter is seeing ...charterfiled... Try making your options like: 1850s 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'> > 1850s > 1860s > 1870s > 1880s > > > > ''year:'' {{!!primary}} > <$count filter="[tag[Company]regexp:charterfiled]"/> > > 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/86ddf2d2-30c1-4a93-aa1c-38101ac4b3b6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.