Forum Discussion
FICO
7 years agoCommunity Manager
How to display VDL-TABLE with entity values across scenarios, relative to the first selected scenario
I have these Mosel entities: KPIs: set of string SummaryKPI: array(KPIs) of real And I have a VDL view with: <vdl-table vdl-if="=scenarios.length > 1"> <vdl-table-column ...
FICO
7 years agoCommunity Manager
Here's my current solution.
<vdl-row vdl-if="=scenarios.length == 2">
<!-- Custom table for comparing two scenarios -->
<div class="table-wrapper">
<table class="insight-table table-main table-condensed">
<thead>
<tr>
<th>KPI</th>
<th vdl-text="=scenario.props.name" />
<th vdl-text="=scenarios[1].props.name">
<th>Delta (abs)</th>
<th>Delta (rel)</th>
</tr>
</thead>
<tbody>
<tr vdl-repeat="=k in scenario.entities.KPIs">
<td vdl-text="=k.label" class="index" />
<td vdl-repeat="=s,i in scenarios"
vdl-text="=insight.Formatter.formatNumber(s.entities.SummaryKPI(k.value).value, '#,##0')"
class="numeric" />
<td vdl-text="=insight.Formatter.formatNumber(scenarios[1].entities.SummaryKPI(k.value).value - scenario.entities.SummaryKPI(k.value).value, '#,##0')"
class="numeric"/>
<td vdl-text="=insight.Formatter.formatNumber((scenarios[1].entities.SummaryKPI(k.value).value - scenario.entities.SummaryKPI(k.value).value)/scenario.entities.SummaryKPI(k.value).value, '#,##0.00%')"
class="numeric"/>
</tr>
</tbody>
</table>
</div>
</vdl-row>
which produces this table:
KPIs Scenario1Scenario 2Delta (abs)Delta (rel)
Revenue 10 20 10 100%
Cost 5 6 1 20%
Related Content
Related Content
Is there a way to export a multi-scenario VDL table?
Hello, One can create a VDL table containing data from several scenarios with: <vdl-table> <vdl-table-column entity="Entity" vdl-repeat="=s,i in scenarios" scenario="=i" head...4 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2Commentsvdl-table default column sort
vdl-table is sorted ascending by the first column by default and the user can easily change this by clicking the column they want to sort by, but how can I change the default sort so all users initia...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread0Views0likes3Comments
