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
How to designate "this note and its descendants"? (Read 2431 times)
Rob Forsyth
Full Member
*
Offline



Posts: 63

How to designate "this note and its descendants"?
Mar 31st, 2013, 11:37am
 
I'm using a rule in a note prototype to define

$TotalDuration=sum(descendants,$DurationInMonths)

where $DurationInMonths is a hopefully self-explanatory Key Attribute.

I'd prefer $TotalDuration to be the sum of $DurationInMonths of this note plus any descendants (so that for notes with no children, $TotalDuration = $DurationInMonths)

Although in other contexts I see "section" is defined as "this note + any children" this doesn't seem to be available as a group designator. Am I obliged to use a conditional rule?

Thanks

Rob

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: How to designate "this note and its descendants"?
Reply #1 - Mar 31st, 2013, 11:57am
 
Quote:
I'd prefer $TotalDuration to be the sum of $DurationInMonths of this note plus any descendants (so that for notes with no children, $TotalDuration = $DurationInMonths)

As stated that implies this is the case even for notes with descendants so no conditional is required. You $Rule should be:

$TotalDuration=$DurationInMonths + sum(descendants,$DurationInMonths)

If you want to use the current note only where there are NO descendants then you do need a conditional rule:

if($DescendantCount){$TotalDuration=$DurationInMonths;}else{$TotalDuration=sum(d
escendants,$DurationInMonths)}
Back to top
 
 

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



Posts: 63

Re: How to designate "this note and its descendants"?
Reply #2 - Mar 31st, 2013, 12:01pm
 
Thanks Mark!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print