Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
134 views

Calculate percentage in report

Jump to solution

Is there a way to calculate percentage in report from 2 different queries? ex: (Query1) / (Query2)]*100%

if it is not possible on ESM can we do such thing on Logger or investigate?

 

 

Labels (2)
Tags (1)
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

Hello, 

Yes you can create a template in ESM of two tables from the Templates tab, edit it in the Designer by right clicking it and choosing "Launch Designer"

In the Designer, you can write script to calculate percentage as follows:

var Percentage = (Table1.data[1][0]/Table2.data[1][0])*100;

then insert a text box and set its value to Percentage

TextBox.text = percentage + '%';

simply just save and run your report in the ESM 🙂

View solution in original post

1 Reply
Highlighted
Trusted Contributor.
Trusted Contributor.

Hello, 

Yes you can create a template in ESM of two tables from the Templates tab, edit it in the Designer by right clicking it and choosing "Launch Designer"

In the Designer, you can write script to calculate percentage as follows:

var Percentage = (Table1.data[1][0]/Table2.data[1][0])*100;

then insert a text box and set its value to Percentage

TextBox.text = percentage + '%';

simply just save and run your report in the ESM 🙂

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.