How to create an Excel background calculation model
Revision as of 13:58, 30 January 2024 by Frank@tygron.nl (talk | contribs)
Panels form a (custom) interface element for the end-user. When backed by an Excel, a Panel can perform calculations and change the state of Items in your project, such as Buildings, even when the Panel is not actually accessible to an end-user.
The instructions below will create a Panel which changes the traffic on all roads in a Project based on the amount of houses added during a Session.
How to add a Panel:
- Create a new Excel file.
- Add a "SELECT_UNITS_WHERE_MAP_IS_CURRENT" cell to the Excel file.
- Add a "SELECT_UNITS_WHERE_MAP_IS_MAQUETTE" cell to the Excel file.
- Add an "UPDATE_BUILDING_TRAFFIC_FLOW_WHERE_CATEGORY_IS_ROAD" cell to the Excel file.
- Add an "EXPLANATION" cell to the Excel file.
- Set the formula of the "UPDATE" cell to "=MAX(0;SELECT_UNITS_WHERE_MAP_IS_MAQUETTE - SELECT_UNITS_WHERE_MAP_IS_CURRENT)".
- In the Editor, add a new Excel Panel.
- Upload the created Excel file for the added Panel.
- Now the amount of traffic on all roads in the Session starts as 0, but increases as the amount of housing in the project is added during a Session.
Notes
- If the Project is set to automatically recalculate, the Panel's will immediately set the traffic in the Project to 0. Otherwise, traffic will change when a calculation has been run.
- The described formula may differ based on language settings for your particular version of Excel.
How-to's
- How to add a Panel
- How to configure a Query for an Excel Indicator
- How to use the Query Tool to test queries from an Excel Indicator spreadsheet