Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Help with Agent query (last N notes) (Read 3515 times)
Jack Baty
Full Member
*
Offline



Posts: 96

Help with Agent query (last N notes)
Mar 15th, 2009, 11:38am
 
I can't seem to find a way to limit the number of aliases contained in an Agent. In my case I need to find the latest 10 notes based on a user attribute "PublishDate."  I have a series of containers, each with a number of notes...

Topics
-> Topic1
-> Topic2
-> Topic3

I want the last 10 notes inside *any* of the topics based on PublishDate. Currently my "Recent" Agent query looks like this...

#indented(2,/Topics)

...but that gives me all notes in the topics when exporting. There's probably another way at this, but I'm having trouble finding it. Nothing like ^children(/Recent,10) I suppose.





Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Help with Agent query (last N notes)
Reply #1 - Mar 15th, 2009, 1:05pm
 
You want first(container,n).  

If it's not convenient to simply invert the sorting order, make an auxilliary agent which looks inside() your first agent and sorts in the opposite direction.

Or (slapping forehead) use last(container,n)
Back to top
 
« Last Edit: Mar 16th, 2009, 3:27pm by Mark Bernstein »  
WWW   IP Logged
Pages: 1
Send Topic Print