How to count number of documents in view category?

Is there a way to count total number of children (and/or total descendants) of a view category, excluding other categories? ie. documents only

I have tried @DocChildren / Descendants and that only seems to return ‘0’.

Subject: How to count number of documents in view category?

Using @Formula, there is an easy way to count the direct descendants: Make a view which shows all responses, and a column, sorted ascending, with the value: @Text($REF). Now you can count the number of direct responses with a @Elements(@DbLookup(“”;“”;“ResponseViewname”;@Text(@DocumentUniqueID);1).

If you want the number of all responses, you would probably need to use a @While() loop, and repeat the above statement (without the @Elements() of course) for each element in the returned list, and repeat the loop until all sublists are processed. This will probably get very complicated with @Formula, so I would do it rather using LotusScript and on the Web.

Oh nevermind, you were talking about Categories, not response documents :slight_smile:

Hmm, with Categories it’s actually even easier: @Elements(@DbLookup(“”;“”;“CategorizedViewname”;“CategoryName”;1))

Subject: RE: How to count number of documents in view category?

That would be ideal if I were looking up the number of elements in a single category.

However my goal is to have sort of a “total” style column.

I have a number of documents sorted by year, then by month.

For example:

2004 (Category for 2004)

->2004-01 (Category for January, 2004)

–>Document

–>Document

->2004-02 (Category for Feb, 2004)

–>Document

–>Document

–>Document

… So ideally I would like to have the “total” column adjascent to 2004-02 display “3”, 2004-01 to display “2”, and 2004 to display “5”.

???

Subject: RE: How to count number of documents in view category?

Oh, so a View would work for you?Then just create a new column1, and put as value: 1, and enable Total display, Hide detail rows.

Subject: RE: How to count number of documents in view category?

Ahhhhhhhhhhh why didn’t I think of that! :slight_smile: Thank you!