<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div>
<h2>API calls to add, get or remove calculated measures</h2>
<p>
Click the <b>Add calculated measure</b> button to add the calculated measure
<code>Average Quantity</code> which is calculated as
<code>sum("Quantity")/count("Quantity")</code>.
</p>
<button onclick="addCalculatedMeasure()">Add Calculated Measure</button>
<p>
Click the <b>Get measures</b> button to get selected measures in the report.
Click the <b>Get all measures</b> button to get all available measures.<br />
The output will appear under the component.
</p>
<button onclick="getMeasures()">Get Measures</button>
<button onclick="getAllMeasures()">Get All Measures</button>
<p>
Use the buttons below to remove either the
<code>Avarage Quantity</code> measure or all calculated measures.
</p>
<button onclick="removeCalculatedMeasure()">Remove Calculated Measure</button>
<button onclick="removeAllCalculatedMeasures()">
Remove All Calculated Measures
</button>
</div>
<div id="pivot-container">The component will appear here</div>
<div class="output" id="output">Output will appear here</div>