How to count filtered pages in reporting?
I have a number of children pages that contain scaffolding data. I was wondering how I could create a sort of summary report on these pages (ie how many pages have field x set to value y?)
I tried the following:
But this obviously doesn't work. Is there a way of doing this in Reporting?
Thanks
I tried the following:
{report-block}
{local-reporter:content:children|source=Analysis}
{text-filter:data:isMappingSame|include=Yes}
{text-filter:data:isOutputSame|include=Yes}
{local-reporter}
{report-body}
Number of attributes with same data and location: {report-info:content:children > collection:size}
{report-body}
{report-block}
But this obviously doesn't work. Is there a way of doing this in Reporting?
Thanks
3
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Currently, not really. You can kind of fake it with {report-table} using 'summaryType' and releated fields, but it's still in a table, which is not ideal. Anyway, do do that, you would have something like this:
{report-table:disableTitle=true}
{local-reporter:content:children|source=Analysis}
{text-filter:data:isMappingSame|include=Yes}
{text-filter:data:isOutputSame|include=Yes}
{local-reporter}
{report-column:summaryType=count|summaryValue=content:title}{report-column}
{report-table}
Essentially you get a two-row table that has a blank first row and the second row has the 'count'. Not great, I agree...
I’m unsatisfied
-
I have a similar case. On the page there is a simple table and I want to count how many items are new, modified and reused. I have followed the instruction above but probably cannot handle the report definition properly.
{table-data:ConsumedServices}
||Service||Usage||
| {text-data:Service}
| {list-data:ServiceUsage}
{list-option}{list-option}
{list-option}new{list-option}
{list-option}modified{list-option}
{list-option}reused{list-option}
{list-data}|
{table-data}
{report-table:disableTitle=true}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=new}{text-filter}
{local-reporter}
{report-column:title=New|nosummaryType=count|summaryValue=data:ServiceUsage}
{report-column}
{report-table} -
Inappropriate?I think you have a typo in your report column ('nosummaryType'). Try this:
{report-column:title=New|summaryType=count|summaryValue=data:ServiceUsage}{report-column}
-
thanks, it works of course! In the example above there is only one column (new), but I need also to display 2 another columns (modified and reused). I have tried to insert another local reporter, but it is not allowed to use another local-reporter in this context. How to display the counts in one table? -
Inappropriate?If modified and resused are in the same scaffold data table, just add extra columns - you don't need to add extra local-reporters. Otherwise, I'll need to see you Scaffolding layout to help further.
-
Inappropriate?if I use additional colums where shall I indicate the filter value for reused and modified?
Table definition:
{table-data:ConsumedServices}
||Service||Usage||
| {text-data:Service}
| {list-data:ServiceUsage}
{list-option}{list-option}
{list-option}new{list-option}
{list-option}modified{list-option}
{list-option}reused{list-option}
{list-data}|
{table-data}
Report definition:
{report-table:disableTitle=true}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=new}{text-filter}
{local-reporter}
{report-column:title=New|summaryType=count|summaryValue=data:ServiceUsage}{report-column}
{report-column:title=Modified|summaryType=count|summaryValue=data:ServiceUsage}{report-column}
{report-column:title=Reused|summaryType=count|summaryValue=data:ServiceUsage}{report-column}
{report-table}
I’m unsure
-
Ah, I see where you're coming from now. Short answer is, you can't do it in a single {report-table}. You will need multiple copies, each with a different filter. You could stick all of them wrapped inside another regular table if you wanted, for layout purposes. -
Inappropriate?I have tried also with the below definition and it works fine but is there any simpler and quicker way to get the report?
||New||Modified||Reused||
|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=new}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=modified}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|
I’m unsure
-
Not yet. There is a new {grouping-reporter} in development that would make life simpler, but it hasn't been released yet. Have a look once 3.2.0 comes out and see if you can update to the new macro. -
Inappropriate?The report below works fine on a sigle page. I would like to get a sum for new, modified and reused from all pages in the space. Shall I use the content-reporter or is possible to use local-reporter with a source parameter?
||New||Modified||Reused||
|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=new}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=modified}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|{report-block}
{local-reporter:data:ConsumedServices}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}|
If local-reporter can be used how to define the source parameter to count data on several pages, for example all children of a specific page? I have tried with the following but get no results. Somehow the table data definition (data:ConsumedServices) has to be put, but where?
||New||Modified||Reused||
|{report-block}
{local-reporter:content:children|source=proj:Projekty}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block} -
Inappropriate?I have tried to set the source parameter as below but get then the eroor "local-reporter: net.customware.confluence.reporting.query.QueryException: Source specified is unavailable: proj:Projekty > children"
|Reused||
|{report-block}
{local-reporter:data:ConsumedServices|source=proj:Projekty > children}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block} -
You can't use the '> children' syntax with 'source' - that only works with 'scope' parameters. Source has to be a specific, individual page/attachment/etc.
You can get all pages in a space using {local-reporter} by using the 'space:all pages' key. That means you need to access a space. Unfortunately, you can't actually specify a space as a 'source'. But you can use the 'page:space' key to grab it. Your local reporter would look something like this:
{local-reporter:page:space > space:all pages:source=KEY:Home}
...
{local-reporter}
If the space you want all pages from is the current space, 'source' is optional. -
Inappropriate?i have tried it, but I get the message
local-reporter: net.customware.confluence.reporting.query.QueryException: Please provide the key to retrieve the value for.
||Reused||
|{report-block}
{local-reporter:page:space > space:all pages:source=KEY:Projekty}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}
As the page is in the same space I have tried also folowing
||Reused||
|{report-block}
{local-reporter:page:space > space:all pages}
{text-filter:data:ServiceUsage|include=reused}{text-filter}
{local-reporter}
{report-body}{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}
but get then 0 as a result which is not right.
Isn't it neccesseary to declare the key for table-data somewhere? data:ConsumedServices -
Inappropriate?It should be a pipe ('|') between 'all pages' and 'source' in your first example, not a colen.
As for the filter, yes you will need to account for the 'data:ConsumedServices' table in your text filter, in this case with a {collection-filter because table-data will contain a list of items. You will also have to use 'reference:value' to access the text of 'ServiceUsage' because it is a list-data field.
I was leaving that as an exercise for the reader, but it should be something like this:
{local-reporter:page:service > space:all pages|source=KEY:Projecty}
{collection-filter:data:ConsumedServices|matchItems=any}
{text-filter:data:ServiceUsage > reference:value|include=reused}
{collection-filter}
{local-reporter}
-
Inappropriate?Thanks David, the report works now as local-reporter but it turned out that it returns the number of pages which contain at least one occurance of 'reused' in the table-data ConsumedServices and I need to count all occurences of 'reused' in the table-data on all pages in the space. Do you have any idea how to get it?
|{report-block}
{local-reporter:page:space > space:all pages|source=Projekty}
{collection-filter:data:ConsumedServices|matchItems=any}
{text-filter:data:ServiceUsage > reference:value|include=reused}
{collection-filter}
{local-reporter}
{report-body}
{report-info:content:title|render=wiki|link=true}
{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}
By the way in the above definition I had to delete the 'KEY' from source and it also works without "> reference:value'. -
Inappropriate?You can do it something like this, but it's hard to do much with the value:
{report-block}
{local-reporter:children}
{text-filter:data:FavColor|include=(?i).*Blue.*}
{local-reporter}
{report-body}{report-body}
{report-footer}Count: {report-info:report:item number}{report-footer}
{report-block}
Obviously you would change your filter. :-)
I’m confident
-
Inappropriate?Ah, ok. In that case you will need to use the {expanding-reporter} to that you can iterate through the table contents directly. Something like this:
{report-block}
{expanding-reporter:data:ConsumedServices|as=service}
{local-reporter:page:space > space:all pages|source=Projekty}
{local-reporter}
{text-filter:data:ServiceUsage > reference:value|include=reused}
{expanding-reporter}
{report-body}
{report-info:expanded:item > content:title|link=true}
{report-body}
{report-footer}{report-info:report:item number}{report-footer}
{report-empty}0{report-empty}
{report-block}
Nice idea using 'report:item number' in the footer - hadn't considered that for count output before.
Let me know how that goes.
Loading Profile...



EMPLOYEE
