Referencing Calculated Columns
Summary
- Once created a Calculated Column can be used and managed like any other Column in AG Grid
- Calculated Columns can also be referenced in AG Grid Charts
Calculated Columns are treated like any other AdapTable (or AG Grid) Column.
Accordingly, a Calculated Column's Expression can reference other Calculated Columns in the Grid if required.
Caution
- There is no limitation on how many Calculated Columns are chained - AdapTableQL will evaluate each in turn
- However at some point performance might be impacted if you have a large chain with complicated calculations
Calculated Columns: Referencing
- This demo contains 3 Calculated Columns, one of which is evaluated based on the other 2
Issues Open/Total Ratio- shows ratio between open and total number of issuesPR Open/Total Ratio- shows ratio between open and total number of pull-requestsScore- is calculated by computing the average value of the previous 2 ratio Calculated Columns (a higher score is better)
Try It Out
- Change a value in
Open IssuesorClosed Issuesand see how theScoreCalculated Column also updates - Change
Scoreto take the maximum value between 'Issues Open/Total Ratio' and 'PR Open/Total Ratio'
Referenced Calculated Columns
(Recorded with AdapTable v16.0)
Calculated Columns in Charts
Calculated Columns, once created, are normal columns and can therefore be referenced in Charts.
If a Chart contains a Calculated Column, then any changes to a Column which is referenced in the Calculated Columns's Expression, will cause the chart to re-render.
Charts Calculated Column
- This example demonstrates how Calculated Columns can be used in Charts
- We create a Calculated Column called
Total PRswhich sums theOpen PRsandClosed PRscolumns - We then create a small Pie Chart which displays the names of the first 5 frameworks and the Total PRs
- Any change to the underlying value of one of the Calculated Column Expression's constituent columns will cause the Chart to redraw
Try It Out
- Set the
Open PRsColumn in the first row (for Vue) to be 22400 and see how the Chart changes