Hierarchical Data
We have shown how the PersisTables Toolkit allows Excel data to be saved and managed from within Excel without requiring expert technical assistance. The demonstration data has been plain ranges of data that can be Tabulated and fed into a CSV file.
However, there are circumstances where multiple ranges are logically part of the same data set. For instance, the annual financial statement and the associated balance sheet may need to be held together. In a similar way, a client order, shipping note and payment receipts would normally want to be held together.
The PersisTables Toolkit allows complex data sets to be easily captured, saved and reloaded. A Table represents the data in a range of cells within an Excel worksheet. When a Table is created, it is represented by a Handle and most PersisTables Toolkit functions operate on that Handle. (Effectively the data held in the range has been compressed into the one cell where the Handle is).
In the example below we have 3 sets of data representing an invoice for an order, the shipping note and the payment receipt. Each has been captured in a Table using the TKTable_Create() function.
xxxx minor changes to data xxxx unit weights 2.5 1.75 3.1… 2.6 2.6 3.1 195.552 ?
The Table handles have been copied next to each other in a summary area and a new Table is created which includes the Handles. Note the “R” in the formula which indicates the Keys to the data are in the left hand column. If a Range used to create a Table includes a Handle then the data the Handle represents is embedded in the newly created (composite) Table. If this Table is saved then the parent and child Tables are saved and reloaded as a single set of data.
If we use the Table Viewer to look at the parent Table, we can see the data hierarchy and contents. The Table Viewer is accessed by right clicking on an approptiate Table Handle.
Note we cannot use a CSV format Protocol for saving hierarchical Tables as a CSV file cannot capture hierarchical data. To save the Hierarchical Table in the ‘Shared’ Arena – which is normally designated to use a ‘CSV’ Protocol – we need to override the Protocol in the Moniker using ‘/BasicText’ or any other appropriate Protocol.
Copyright © 2020 Persis Solutions Limited