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
Count of Count (Read 2556 times)
MichaelB
Full Member
*
Offline



Posts: 25

Count of Count
Feb 03rd, 2013, 3:13pm
 
Hello,

I'm a real newbie and creating actions.  I have an agent that collects everything with $Prototype="Task" (and am using built-in prototype).

On this agent, I want it to display "number of completed tasks" of "number of total tasks"

Using Display Expression -- I get the part right for number of tasks completed, but can't get the count of total tasks.

I'm using:

"Tasks Completed = " +count($Completed="true") + " of "

Don't know how to finish it.

Any help much appreciated.  Thanks.
Back to top
 
 
  IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Count of Count
Reply #1 - Feb 3rd, 2013, 3:40pm
 
More elegant solutions exist, but try:

Code:
"Tasks Completed = " +count(collect(children,$Checked=="true"))+ " of " +$ChildCount 



You wrote that you're using the inbuilt "Task" prototype, so the attribute to count is $Checked, unless you've renamed the attribute to $Completed.  Also, while $Checked="true" will work (for now), it is deprecated in a test such as this, and $Checked=="true" is preferred.
Back to top
 
« Last Edit: Feb 3rd, 2013, 3:42pm by Paul Walters »  
  IP Logged
MichaelB
Full Member
*
Offline



Posts: 25

Re: Count of Count
Reply #2 - Feb 3rd, 2013, 4:06pm
 
Paul,

Thank you very much.  That worked.

Michael
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print