As discussed at http://www.sqlnotes.net/drupal5/index.php?q=node/2070#comment-9119, you can do something like the following to use more than one field of your children in your column equation.
Parents = mySum(IncludeField, children)
Function mySum(IncludeIt, x) ' Calculates the sum of the array x if IncludeIt is true
dim d, i
d=ubound(x)
for i=0 to d
if IncludeIt(i)=true then mySum = mySum+NZ(x(i))
next
end Function
So the function is passed arrays of children's field values for IncludeField and whatever field the equation is defined in. Unfortunately this isn't what I need. What I would like to do is use the Parent's field in the equation. So I want something like this:
Parents = MyValueOrSum(ParentField, children) Function MyValueOrSum(myField, x)Dim d, iIf Not (IsNull(myField)) Then MyValueOrSum= myField Exit Function End If MyValueOrSum = Sum(x) End Function
Is this possible somehow?
d
Comments