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
Hi Alex, if all you need is to display differences with the first column then a custom render function may be your best bet.
<script>
function differenceFn(data, type, rowData, pos) {
if (type === 'display') {
if (pos.col > 1) {
var baseVal = rowData[1];
var diff = data - baseVal;
var diffToken = diff < 0 ? '-' : '+';
var percent = (100.0 / baseVal) * diff;
return diffToken + diff + ' (' + Math.round(percent) + '%)';
}
return data;
}
return data;
}
</script>
<vdl-table vdl-repeat-contents="=s,i in scenarios">
<vdl-table-column entity="NAGENTS" scenario="=i" editable="true" render="=differenceFn"></vdl-table-column>
</vdl-table>
This will display the differences similar to how you requested in your first request and doesn't require you to create your own table from scratch.
You would probably want to round differently and also use the name of the scenario in the table column heading attribute.
HTH, Joc
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
