Calculation with report-on & report-block & report-body

Hi All,

Any ideas how I can run sum simple maths using the code below?

I need to subtract "report-info:data:Sum" from "report-info:data:startvalue"

Any ideas?

Cheers

|| Starting Value || Difference || New Value |
|{report-on:injected=true}
{report-block}
{local-reporter:page:children|source=PAGETITLE0 Portfolio}
{text-filter:page:title|include=.*%data:Client > page:title%.*}
{local-reporter}
{report-body}{report-info:data:startvalue|format=£###,###.##} {report-body}
{report-block}
{report-on}  |  | {report-on:injected=true}
{report-block}
{local-reporter:page:children|source=PAGETITLE0 Portfolio}
{text-filter:page:title|include=.*%data:Client > page:title%.*}
{local-reporter}
{report-body}{report-info:data:Sum|format=£###,###.##} {report-body}
{report-block}
{report-on}  |

					
				
			
			
			
				

2 answers

I'm a little confused about exactly what you're trying to output here, and why you're not using a {report-table} instead of {report-block}.

To do maths, you use the {report-eval} macro. Something like '{report-eval}%data:startvalue% - %data:Sum%{report-eval}' in your case. But I"m confused by the rest of the report, I'm afraid. I would expect you would just do something like this:

{report-table}
{local-reporter:page:children|source=PAGETITLE1 Portfolio}
  {text-filter:page:title|include=.*%data:Client > page:title%.*}
{local-reporter}
{report-column:title=Starting Value}{report-info:data:startvalue|format=$###,###.##}{report-column}
{report-column:title=Difference}{report-info:data:Sum|format=$###,###.##}{report-column}
{report-column:title=New Value}{report-eval}%data:startvalue% - %data:Sum%{report-eval}{report-column}
{report-table}

Hello!

For any calculations in Confluence, including any manipulations with table data, you may use CelesteCS Math for Confluence.

Assume you have a table with three columns and three rows on your page – from A1 till C3, where row 1 is the header row. The sum calculation formula for rows 2 and 3 will be simple:

SUM(Table1.A2:C3)

There is a plenty of other functions in the macro, so you may perform any calculations using formulas in EXCEL style.

Thanks!

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

98 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you