You are viewing limited content. For full access, please sign in.

Question

Question

Audit trail on Number of Records in Each Folder

asked on February 1, 2019 Show version history

What is the easiest way to run a report showing the total number of records in every folder created?

0 0

Answer

SELECTED ANSWER
replied on February 4, 2019

Or, if getting direct access to SQL is not easy, you can download the entry creation events for the given time range from the Audit Reporter as an Excel spreadsheet and use pivot tables to aggregate the data by folder ID.

2 0

Replies

replied on February 1, 2019 Show version history

It's certainly possible. However, it won't be efficient to do it with built in tools. You'll want to query directly against the repository database.

Here's what a naïve implementation would look like.

SELECT COUNT(*) AS DocumentCount, t1.name AS ParentFolder
FROM LF_Repository.dbo.toc AS t0
LEFT OUTER JOIN LF_Repository.dbo.toc AS t1 ON t1.tocid = t0.parentid
WHERE t0.etype = -2
GROUP BY t1.name

However, there are some issues that come to mind. This particular query will only tell you how many documents are in a folder. If there are subfolders, they won't be part of the count of that folder. It will also give you the count for subfolders without differentiating them from their parent. If you want to do a rollup of document counts starting at a certain level in the tree, that's yet another possible query.
 

If you can tell us more about what the goal of the report is, we might be able to come up with a better solution.

2 0
SELECTED ANSWER
replied on February 4, 2019

Or, if getting direct access to SQL is not easy, you can download the entry creation events for the given time range from the Audit Reporter as an Excel spreadsheet and use pivot tables to aggregate the data by folder ID.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.