Skip to main content
Skip table of contents

Insert the calculation macro

Insert your first calculation macro

Any user who has edit permissions on the space will be able to add and edit the macro.

First, anywhere in your page, add the macro using /calculation or /variable or /yogi.

Screenshot from 2025-07-21 16-54-47.png

Then, in the popup, you can define your formula or expression by typing its formula.
For details, please checkout out Calculation syntax.

Once done, you can validate and your macro will be inserted in the page.

Screenshot from 2025-07-21 16-55-16.png

You can now see the macro with the result of your processed formula / expression.

By hovering the macro, you will have access to the formula to gather details.

Screenshot from 2025-07-21 16-55-56.png

Save a calculation as a variable

To improve consistency between your data, you can also save your previously inserted macro to reuse it later. If you want to see more details about variables, find the documentation: Create and reuse variables .

Once you’ve added your calculation in the page, you can activate the Save as variable option allowing you to name your variable.

Note that if two variables have the same name, we’ll apply the results using the closest variable (current page > space > instance).

Screenshot from 2025-07-21 16-56-21.png
Screenshot from 2025-07-21 16-56-33.png

The rendering is the same as a unnamed macro.

Screenshot from 2025-07-21 16-57-03.png

However whenever you insert a new macro, you can reuse the saved calculation as a variable.

  • The syntax is to prefix its name with a $.

Screenshot from 2025-07-21 16-55-57.png

And just like that, you can build dynamic Confluence pages based on calculated data.

Limitations:
Please note that the calculation are processing variables only up to 5 levels deep. So If you have a variable, built using another variable, and so on, more than 5 times, the calculation won’t be processed.

Screenshot from 2025-07-21 16-55-59.png
Screenshot from 2025-07-21 17-00-36.png

Can the macro be exported ?

With Confluence’s native feature to export pages to Word or PDF, you can download your pages and Yogi Calculations - Formulas and Variables for Confluence macros will be downloaded as well.

Screenshot from 2025-07-21 17-00-59.png
Screenshot from 2025-07-21 17-01-20.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.