Adding an Expand Set for Time Series

If a cBase includes multiple time periods, it can often support use of time series. Because this function generates additional columns, you might want to define an expand set to improve the user experience. This procedure walks through an example.

  1. In your Workbench project, identify the cBase and right click to select Open with > cBase Viewer.

    A Closedtab for the cBase opens.

    Open cBase Viewer

    As needed, examine the Build Script or use the Open in ProDiver option to verify column names.

  2. In the Workbench Explorer pane, right-click the appropriate folder and select New > cPlan.

    A New cPlan.cplan tab opens.

  3. Rename the file. For example, basic_timeseries.cplan.

  4. Edit the cPlan to create a simple time series. For example, name the cBase, specify a few dimensions, and use the time-series block with only a few options. Here is an example of a ClosedcPlan using a time-series block.

    cplan { 
      cbase-input "/cbases/NY.cbase" 
      dimension "Resp Team" label = "Team" 
      dimension "Resp Salesperson" label = "SalesPerson" 
      
      time-series { 
        date `value("Posting Period")` 
        anchor `date("2013/06/01")` 
        summary "Cases" 
        ranges { 
          all-quarters 
        } 
        variations { 
          previous-years 3 
        } 
      } 
    } 
  5. Click on Run from the Workbench menu, or use Ctrl+R, to run Spectre with the cplaninfo option.

    The Output displays in Workbench.

  6. Examine the Output to verify the new column names. Here is an Closedexample of the Output.

    cPlan for time series

  7. Locate the appropriate divetab script with a data-area where you want to display these new columns.

  8. Add a definitions block with a column-set with nested expand blocks for the first two quarters. Here is an Closedexample of a definitions block.

  9. Add or edit a report-page block so it uses the new column-set. Here is an example of a Closedreport-page using a column-set.

  10. Save the divetab script and run a test, making sure to Sync before testing.

    Here is the Closedresulting report page.

    Report page initial view

    Here is the report page Closedwith columns expanded.

    Report page with columns expanded

  11. Add formatting to summary values and change column headings if needed. Here is an example of Closedtext columns with formatting.

  12. Save the script, return to the client and Sync.

    Here is the Closedresult of the formatted report page.

    Expaned columns with numbers formatted

See also: