Column Set Code Samples

The following example of a column-set includes some expansion columns.

  column-set id = "cs-pastyears" { 
    text column = "Cases" { 
      expand "Past Years" { 
        text "Cases Y" column = "Cases Y" 
        text "Cases Y-1" column = "Cases Y Y-1" 
        text "Cases Y-2" column = "Cases Y Y-2" 
        text "Cases Y-3" column = "Cases Y Y-3" 
      } 
      expand "Last Year" { 
        text "Cases <br> Last Yr" column = "Cases Y Y-1" 
        text "Q1" column = "Cases Q1 Y-1" 
        text "Q2" column = "Cases Q2 Y-1" 
        text "Q3" column = "Cases Q3 Y-1" 
        text "Q4" column = "Cases Q4 Y-1" 
      } 
    } 
  } 

Once defined in the definitions block, pages can refer to the column-set by name.

  report-page { 
    title "Report page - Definition with col set" 
    cplan "/cplans/basic_timeseries.cplan" 
    dimension "Resp Team" 
    column-set id = "cs-pastyears" 
  } 

Here is the in DiveTab with Last Year expanded.

The following example involves time series columns defined in the cPlan. A parameter is used to select one summary column.

  column-set id = "month_detail" { 
    take-parameter "summary" 
    text column = "$(summary) Y" 
    text column = "$(summary) Y Y-1" 
    text "%Chg" column = "$(summary) Y Y-0 % Diff" 
  } 

Here is how the column-set is referenced in the data page.

  ad-hoc-page id = "summary_info_profit" { 
    title "Summary Info" 
    cplan "/cplans/basic_timeseries.cplan" 
    dimension "Corporate Brand" 
    dimension "Corporate Supplier" 
    column-set id = "month_detail" { 
      pass-parameter "summary" "Cost" 
    } 
  } 

Here are the in DiveTab.

Notice how the Cost and Cases columns have three decimal places. You can format these columns within the divetab or cplan script.

See also: Formatting Column Data