Tinderbox Forum

Agents to capture events within or before dates

Hi, would welcome some help on what I’m sure should be pretty basic but eludes me. I’d like to set up agents to capture event notes between, before or after certain dates.
I can’t seem to find the right syntax for this. I’m trying something like this:

$Prototype==“Event” AND $StartDate>year(1940)

though have tried lots of permutations of this, none of them working. Some exclude some events, but not always all the right ones. What am I doing wrong?

The goal would have to have several different timelines depending on the epoch. (I realise one way to do it would be to have the timelineband limit the number of events on the timeline itself, but having separate timelines seems more elegant, and allows for flexibility over the granularity of each timeline).

Many thanks, as ever.

So, you want the year of $StartDate to be after 1940? Try:

$Prototype=="“Event" & $StartDate.year > 1940

Fixes:

  • Use straight quotes for the prototype name (this may just be forum auto-formatting.
  • In Tinderbox queries use the ampersand & for AND joins and the pipe | for OR joins. AND/OR/NOT have no meaning in Tinderbox queries.
  • To compare the year segment of a date in a Date-type attribute use the .year() operator. This can then be compared to a literal number.

Thanks for this, Mark. That works, many thanks.

1 Like