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
Using agent to calculate sum of attribs? (newbie) (Read 3033 times)
Ton Zijlstra
Full Member
*
Offline



Posts: 2

Using agent to calculate sum of attribs? (newbie)
Dec 25th, 2009, 11:07am
 
Not sure if this is possible, or if an agent is the right way to do it.

I have notes that have a certain prototype (project, or lead)
These notes have two user-created attributes mindays and maxdays

Now I want to find a way to see the sum of mindays for all notes with prototype project, and the same for the sum of maxdays, and also both for all notes with prototype lead.

How to go about this? Is using an agent a solution? Where and how do I get to display the result of a sum like described above.

Am a very confused newbie.

best,
Ton
Back to top
 
« Last Edit: Dec 25th, 2009, 11:08am by Ton Zijlstra »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using agent to calculate sum of attribs? (newbie)
Reply #1 - Dec 26th, 2009, 5:29am
 
Yes, use an agent. First find all notes that matching the two prototypes of interest. Use this AgentQuery:
  ($Prototype=="project") | ($Prototype=="lead")

Now we want the agent to sum the maxdays and mindays of all its children (the aliases collected by the agent) so give the above agent this Rule:
  $maxdays = sum(child,$maxdays); $mindays = sum(child,$mindays);

For final polish, open the Info view for the agent, select the 'General' group and select the box next to 'DisplayExpression' and click the Edit button.  Enter this:
  $Name + "  (Max: " + $maxdays + ", Min: " + $mindays+")"

Now your agent's name should show the live count of each attribut safter the agent's name.

Tip: if you're starting out, take a look at this aTbRef page on naming attributes.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ton Zijlstra
Full Member
*
Offline



Posts: 2

Re: Using agent to calculate sum of attribs? (newbie)
Reply #2 - Dec 28th, 2009, 11:39am
 
Great Mark, Thanks for that answer. Trying stuff out now.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print