Object Swapping

Example

Consider that you want to have four different charts on a category all measuring different things in different ways but you also want the ability to show these same four charts by five different dimensions. Although copying charts and changing their dimensions is fairly easy you would nevertheless then have twenty different charts to maintain and manage.

The solution

You can use Object Swapping to dynamically change the dimension on each of the charts.

The steps

Build an Object to Return the Object Names

Go into the ‘Dashboard Repos’ Data Connection. You need to build an object over the MIS_COLUMNS table in the Dashboard Repos, the primary column you are interested in is DISPLAY_NAME ; this will list all your Dashboard data objects. You also need to know the SERIAL of the table(s) you are interested in. The best way to find this out is to use the ‘Sample data’ button against MIS_TABLES, in this case I am interested in vw_pandash_SLCustomerAccount as shown below.

We can then construct the new object over DISPLAY_NAME so that it just brings back the objects we want to ‘swap’:

Note that:

  • This object has been named ‘X Axis’

  • The WHERE clause is referencing the internal piDashboard object names, NOT the underlying field names on the database.

Reference That New Object In The Category Object 

You can still ‘mix and match’ this object with others including, in this example, ‘Customer Account Manager’ which is one of the possible ‘Swappable’ objects we are going to return.

  • ‘Can Select All’ is disabled.

  • ‘Filter’ is disabled.

Create the Swappable Object

In your actual data connection, on the relevant table, create an object which references the ‘ X Axis‘ object;

Create Your Chart(s)

  • Use SwapX as the Dimension

  • Optionally: Reference {{X Axis}} in the chart name (or Sub Title)

  • Optionally: Reference {{X Axis}} in the X Axis Label

The chart will swap the X Axis depending on what you select from the Category Object and this will work on all correctly constructed charts in the category:

If a chart doesn’t reference ‘X Axis’ (such as the one in the top right-hand corner) then it won’t be changed as a result of what you select from that drop list Category Object.