diff --git a/docs/roadmap.md b/docs/roadmap.md index fe5986a..b1ec2c1 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -35,29 +35,25 @@ The above rules will apply only at frontend, and will be configurable in the MPE **Frontend Formulae** -An example of a simple rule would be: +The plan here will be to introduce [hyperformula](https://hyperformula.handsontable.com/guide/demo.html) into HandsOnTable. It will allow a library of ~400 functions and advanced excel-like behaviour. It integrates natively [as a plugin with HandsOnTable](https://handsontable.com/docs/javascript-data-grid/formula-calculation/#available-functions). -```sas - REVENUE = PRICE * VOLUME -``` - -How to apply this in Data Controller? Let's consider a table as follows: - -|ITEM|PRICE|VOLUME|REVENUE| -|---|---|---|---| -|PAPER|4.20|100|`= PRICE * VOLUME`| -|PEN|61.02|1,971|`= PRICE * VOLUME`| - -The plan here will be to introduce [hyperformula](https://hyperformula.handsontable.com/guide/demo.html) into HandsOnTable. It will allow a library of ~400 functions and advanced excel-like behaviour. - -HyperFormula requires cell references to operate (rather than named variables), eg as follows: +The initial challenge will be that HyperFormula requires cell references to operate, eg: |ITEM|PRICE|VOLUME|REVENUE| |---|---|---|---| |PAPER|4.20|100|`= B1 * C1`| |PEN|61.02|1,971|`= B2 * C2`| -For ease of use, and to avoid the need to hard code a particular column order, the frontend should perform replacement of the variables for each Formula cell. For instance, replacing ` PRICE ` with ` B1 ` and ` VOLUME ` with ` C1 ` in the first row (and with ` B2 ` and ` C2 ` in the second row respectively). +Whereas end users cannot know these references ahead of time. Therefore the references will be made using variable names, eg: + + +|ITEM|PRICE|VOLUME|REVENUE| +|---|---|---|---| +|PAPER|4.20|100|`= PRICE * VOLUME`| +|PEN|61.02|1,971|`= PRICE * VOLUME`| + + +The frontend can then perform replacement of the variables for each Formula cell. For instance, replacing ` PRICE ` with ` B1 ` and ` VOLUME ` with ` C1 ` in the first row (and with ` B2 ` and ` C2 ` in the second row respectively). To avoid clashes with names that match function names (eg, `MATCH()`) each named variable **must have a leading and trailing blank**, and we should be sure to ignore variables inside of single or double quoted strings - eg ` ITEM & " string ITEM "` (would resolve to `A1 & "string ITEM "`).