One of the most powerful functions in AdaptableBlotter.JS is Calculated Columns, which allows you to create your own columns at run-time.
Unlike 'regular' columns, Calculated Columns do not store data; instead you create an Expression which is evaluated per row.
Calculated Columns can either be static (i.e. show a single value) or dynamic (i.e. based on other columns in the row).
There are numerous potential uses for Calculated Columns including showing Historical Data, and allowing you to do 'what if' or scenario analysis by copying some columns and see what happens if you change their values.
The Expression in the Calculated Column updates in real time as values in the columns which form part of that expression change.
Start the Calculated Column wizard by clicking the 'New' button in the Calculated Column popup and choose a name for the Column in the first step.
Next you will create the Expression. This will typically include a mathematical operator and reference other columns. There is a huge array of potential mathematical operators that you can use to create your Expression.
Behind the scenes we use the Math.JS library to evaluate the Expression.
We plan in future releases to enable drag and drop so that you can more easily reference other columns when creating a Custom Column Expression.
You can include as many operators as you want in your Expression: there is no limit on the number of operators or the number of other columns that you can reference.
If you want to refer to other columns in the Expression you need to reference them as Col("ColumnName"). (e.g. Col("Bid").
You can use either the column's field name (the private identifier for the column used by the underlying grid - e.g. Col("orderId") ) or its Friendly Name (the Caption displayed for the Column in the Header row - e.g. Col("Order ID") ).
You can edit, delete and share Calculated Columns as you can with all Adaptable Blotter Objects.