I'm having a problem with getting eval-data to work in my report, the report-table shown below shows the component and outage sum correctly but not the percentage. Seems there is an issue with getting a value back for %Site-AvailabilityOutageTotal% but I can't figure out what.
{table-data:Component-Availability}
||Component||Outage Summary||Linked ID||Linked OID||Outage||
| {list-data:Site-Component}
{list-option}API{list-option}
{list-option}Admin Console{list-option}
{list-option}FTP{list-option}
{list-option}Search{list-option}
{list-option}Website{list-option}
{list-data} | {text-data:Site-AvailabilitySummary} | {text-data:Site-AvailabilityID} | {text-data:Site-AvailabilityOID} | {number-data:Site-AvailabilityOutage|decimal=true} minutes|
{table-data}
{report-table}
{grouping-reporter:data:Site-Component|as=Component}
{grouping-stats:data:Site-AvailabilityOutage|as=Count}
{local-reporter:data:Component-Availability}
{text-filter:data:Site-Component|value=Website}
{text-sort:data:Site-Component|order=ascending}
{local-reporter}
{grouping-reporter}
{report-column:title=Component}{report-info:grouped:Component}{report-column}
{report-column:title=Outage}{report-info:grouped:Count > stats:sum} minutes{report-column}
{replace-and-render}{replace-item:%NumberOfDays%}{get-data:name=reporting-days}{replace-item}{replace-item:%Site-AvailabilityOutageTotal%}{report-info:grouped:Count > stats:sum}{replace-item}{replace-body}{report-column:title=Percentage}{eval-data:Percentage|format=#0.00}round((((60*24*%NumberOfDays%)-%Site-AvailabilityOutageTotal%)/(60*24*%NumberOfDays%))*100, 2){eval-data}%{report-column}{replace-body}{replace-and-render}
{report-empty}Nothing to see.{report-empty}
{report-table}
Hi Charlie,
They can work together, but you can't put {eval-data} macros into a report. Reports can pull values from {eval-data} that is in a Scaffolding {table-data} or {repeating-data} however.
If you want to do maths inside a report, use the {report-eval} macro instead. It works quite similarly to the {eval-data} macro, but has a slightly different syntax. Also, values are only stored for the life of that specific page view, whereas for {eval-data} they are stored more permanently with other Scaffolding data.
In any case, to get your report working there are two options:
1. Move the {eval-data} into the {table-data} instead, then refer to it as you would any other Scaffolding data field (ie. '{report-info:data:Percentage}').
2. Use {report-eval} instead, like so:
{report-column:title=Percentage}
{report-eval:Percentage|format=#0.00}round((((60*24*%report:content root > data:reporting-days%-%grouped:Count > stats:sum%/(60*24*%report:content root > data:reporting-days%))*100, 2){report-eval}
{report-column}
Note that you can completely remove the {replace-and-render} from this report. Also, I'm assuming that 'reporting-days' is a {number-data} field on the page somewhere that you haven't listed.
In general, it's best not to mix Scaffolding macros into reports. You can do the reverse quite safely - put Reporting macros into {table-data}/{repeating-data}, but it doesn't work so well in the other direction.
Hope that helps!
Hi David,
Thanks for the detail, I tried that out but I got an error:
round((((60*24*%report:content root > data:reporting-days%-%grouped:Count > stats:sum%/(60*24*%report:content root > data:reporting-days%))*100, 2)
Using the information around report-eval I was able to resolve and complete my report.
Many thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! I was just attempting to copy your example, but I probably missed a closing bracket somewhere...
Glad it's working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I was wondering is it also possible to perform calculations using Jira Issues macro?
For eg:
i took too Jira issues count : so it would display as "23 Issues" and another as "40 Issues"
so Can i see the total as "63 issues"?
or
is there a way i can view the jira issues count as a numeric value so then i can use the "Eval data" macro and perform calculations?
kindly, help out if possible.
Thank you.
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.