Skip to content

04 Maintenance & Repairs

fubits edited this page Mar 31, 2021 · 3 revisions

Input Sheet Maintenance

See Notion for Overview

TODO: document datalab/19_inputStepInjector.js/mainInputStepExtender()

For the 2020 Index, the functionality to repair / update / extend Input Spreadsheets has been redesigned. The Pilot's module has been deprecated.

Fixing & Updating

Maintenance of NamedRanges, Labels, and Formatting is now enabled by the

  • mainInspectInputSheets() Caller & the 70_inspectSpreadsheets.jsModule (--> Documentation), and
  • mainRepairInputSheets() & the doRepairsOnly flags in the 10_inputInterface.js Module and Submodules (--> Documentation)

Important: mainRepairInputSheets() has to be executed with data@ if sheets are locked/protected

mainRepairInputSheets() calls processInputSpreadsheet() and therefore follows the same logic as the regular Input Spreadsheets process. Based on the doRepairsOnly flag, every subcomponent which usually would manipulate non-label Cells with Cell.setValue(cellValue : string) is skipped. Everything else is updated from scratch, incl. the re-assignment of Named Ranges.

One exemption to .setValue() are subcomponents which do not require user input (such as the automated year-on-year comparison).\n\nIn theory, the logic could be extended to also update N/A-hardcoded cells, since these are more or less guaranteed to be correct.

After processInputSpreadsheet() has succefully finished updating the File, processCompanyHealth() is run to verify that no ranges are broken anymore.

Extending / adding new steps

  • similar logic like updating
  • utilises the 'addNewStep' flag in combination with startAtMainStepNr and Config.subsetMaxStep: MainStepNr
  • mainInputSheets() calls the regular Input Sheets routine, but skips previous Main Steps < startAtMainStepNr
  • process then fetches IndicatorSheet.getLastRow() and adds n Main Steps defined by [startAtMainStepNr, Config.subsetMaxStep]

In theory, this Logic can also be used to update only specific main steps. I.e. combined with filterSingleIndicator(indicatorsVector, "G2") one could update only F1, Step 2 for all companies.\n\n Important: mainRepairInputSheets() has to be executed with data@ if sheets are locked/protected