开发者

@DocDescendants and @DocChildren are special text

开发者 https://www.devze.com 2023-02-18 11:18 出处:网络
I got an error when I used this operation (Incorrect data type). I want to get the average of the below formula. What is the correct formula to get the average of @DocDescendants and @DocChildren? OR

I got an error when I used this operation (Incorrect data type). I want to get the average of the below formula. What is the correct formula to get the average of @DocDescendants and @DocChildren? OR is there any alternative way to count the category and sub categor开发者_开发百科y then get the avg for each category?

avg:=@DocDescendants/@DocChildren;

OR this also

avg:=@Text(@DocDescendants/@DocChildren);

OR this also

avg:=@ToNumber(@DocDescendants)/ @ToNumber(@DocChildren);


@DocDescendants("%") will return with actual number of decendant documents and @DocChildren("%") will return number of child records, if you omit the "%" then return value is unusable 'special text', there are other optional parameters which are well documented in domino designer help.

note: "%" returns a string so to compute average you'll need to wrap the value in @textToNumber, You might also need to wrap the calculation in @Error to handle docs with no responses which will mean your attempting a division by zero. This might all seem complicated, and another reason to grumble at Lotus but Formula language once you get your head around it is blindingly fast and very powerful.


Haven't tried that, but just looked it up in the help and it says "You cannot convert special text to a number." I guess that's what's special about it :) Must be something about the inner workings of the view indexing...
Anyway, knowing about the limitations of other formulas in the views, the only think I can think of is running an agent that goes through the entries in the view and for document entries uses the NotesViewEntry.DescendantCount and NotesViewEntry.ChildCount to calculate the value and save it in the document. It could be a scheduled agent (sighed with an ID that has access to edit the documents).

Does that help?

0

精彩评论

暂无评论...
验证码 换一张
取 消