Information Tables with Multiple Headers

This example will highlight some additional features of the Oasis product. The following table is typical of the kind of information captured in a spreadsheet, where columns are organized using a header with multiple rows.

Lets say that we want to create a dashboard showing values over time. Then this table needs to be modified to show values in a single column for simpler plotting. We also need to add a calculated column to the model that calculates a date. We then sort the rows by this calculated date. The resulting model looks like this:

Notice that the ‘unpivot’ step has moved column values into rows under Field1, Field2 and Field 3. The value column now contains all the values in the original table.

The last column is a calculated column. Oasis includes a comprehensive math library that has been extended to understand other data types, such as colors, dates, complex numbers, arrays, JSON objects, and strings. In this example the formula used is as follows:

Date(concat('15 ', ",,Field 3", ' ', ",,Field 1")).toISOString()

Three items are concatenated as a string – ’15 ‘, the month name, and the year. Together (for example ’15 Aug 2023’) this is sufficient to create a date object. The function on the end converts this to an ISO format better used for chart use.

Together, these items can be quickly assembled in a dashboard, for example:

Note that the original table (with multiple headers intact) is shown at the top. The table below on the right shows the unpivoted table – with some differences. The chart on the left is a plot against date of the values, separated by product name.

A few things to note:

  • Oasis has a table designer, so information in a table can be beautified. Here for the lower table, some of the columns have been hidden (Field1, Field2 and Field3) and a bar chart plotted instead of values for the value columns. Conditional formatting has also been applied to the text color.
  • Oasis has a comprehensive chart designer that can display many kinds of charts. Here a log plot of values against date are shown. The chart designer can create subseries based on a field value – in this case the Product Name – and separate out into separate plots. This saves having to create an addition step in the model that pivots the data into three product columns.
  • The model and view operations are able to process and preserve a table with a complex multi-row header
  • The dashboard is fully interactive. Clicking on table cell or a chart point filters the other components accordingly

For example clicking on the Banana cell:

This post has shown how multi-row table headers are managed in Oasis, using the unpivot and calculated column in a model example.

Back to Exploring

trudain.com | All content copyright (c) 2022-2024