What is a Parameter?

A parameter is a string of characters that is replaced at run time with a defined value. Parameters are used as placeholders. There are two main types of parameters used in DiveTab: column-set or expand-set parameters, and data page parameters.

Column and Expand Set Parameters

Column set or expand set parameters identify the placeholder value with the take-parameter tag and the replacement value with the pass-parameter tag. This allows for a column-set or expand-set to be used multiple times with different summary columns.

The take-parameter tag is used in the column-set or expand-set in the definitions block of a data-area. When the column-set or expand-set is referenced in the data page, the pass-parameter tag identifies the placeholder value and the replacement value.

Here is an Closedexample of a report page using an expand-set parameter, with the columns expanded.

Example of a Column Set Parameter in use.

Here is the Closedreport page in the code, using the parameter reference $(<parameter name>).

  definitions { 
    column-set id = "pastyears" { 
      take-parameter "summary name" 
      text "$(summary name)" column = "$(summary name)" { 
        expand "Past Years" { 
          text "$(summary name) Y" column = "$(summary name) Y" 
          text "$(summary name) Y-1" column = "$(summary name) Y Y-1" 
        } 
      } 
    } 
  } 
  data-area id = "NY Data" { 
    title "Pass/Take Parameters" 
    icon "/divetab/images/Data288.png" 
  sections { 
      report-page { 
        title "RP - Parameters" 
        cplan "/cplans/basic_timeseries.cplan" 
        
        dimension "Corporate Chain" 
        column-set id = "pastyears" { 
          pass-parameter "summary name" "Cases" 
        } 
      } 
    } 
  } 

Notice how Cases replaces $(summary name) in the columns.

The pass-parameter tag can be used multiple times with any available summary. For example, you can use the same column-set a second time with summary Cost.

CAUTION: If you use the time series as part of the column-set, verify that the summary you use is included in the time series.

Page Parameters

Page parameters identify which values are accepted by a target page. All dimensions are passed from a parent data page to a child data page, but only specified dimensions and values are accepted by the child page.

A link on the parent page identifies the dimension and dimension value that is passed. The target page parameter identifies which dimension, and therefore the dimension value, is accepted. The parameter appears as a QuickView on the target page with the dimension and dimension value, which allows you to change values on the target page.

The parameter tag is primarily used to identify the accepted dimensions for a target page. In addition to the basic page parameter, there are four page parameter types:

  • Anchor Date Parameters—Identifies an anchor date that is shown and changed using a QuickView. Those changes are accepted by the target page as a parameter.
  • Conditionalized Link Parameters—Identifies specific dimension values that meet certain conditions to have active links. Values that do not meet the conditions do not have active links and are therefore not passed to the target page.
  • Dimension Value Parameters—Identifies a dimension and dimension value, not visible in the page or related to the link, to pass to the target page.
  • Parameter List Parameters—Identifies a metrics, or column, that is used in a data page and can be changed using a QuickView. Those changes are accepted by the target page as a parameter.

IMPORTANT: QuickViews and their dimensions also need parameters identified to be accepted by the target page.

Here is an Closedexample of an ad hoc page.

Example of an Ad Hoc page with links to a Report page.

Here is an Closedexample of a report page after following the link for DIAGEO.

The resulting Report page after clicking the link.

Notice that the Cases total is the same. This is because a parameter is not in use, so the value is not accepted by the target page.

Here is how these Closedpages appear in the code.

  sections { 
    ad-hoc-page { 
      title "Ad Hoc Page" 
      cplan "/cplans/basic_101.cplan" 
      dimension "Vendor"
      dimcount-dimension "Resp SalesPerson" 
      text column = "Cases" { 
        link { 
          page id = "rp-param" 
        } 
      } 
    } 
  } 
  
  pages { 
    report-page id = "rp-param" { 
      title "Report Page" 
      cplan "/cplans/basic_101.cplan" 
      
      dimension "Product Name" 
      text column = "Cases" 
    } 
  } 

The following example is of the same ad hoc and report pages, but with a parameter applied.

Here is an Closedexample of the report page after following the link for DIAGEO, with a parameter in use.

Notice the QuickView for Vendor with the DIAGEO value selected. The QuickView can change the dimension value without returning to the previous page. Also notice that the Cases total for the report page matches DIAGEO's total from the ad hoc page.

Here is how these Closedpages appear in the code.

  sections { 
    ad-hoc-page { 
      title "Ad Hoc Page" 
      cplan "/cplans/basic_101.cplan" 
      dimension "Vendor"
      dimcount-dimension "Resp SalesPerson" 
      text column = "Cases" { 
        value-format "#,###.00" 
        link { 
          page id = "rp-param" 
        } 
      } 
    } 
  } 
  
  pages { 
    report-page id = "rp-param" { 
      title "Report Page" 
      cplan "/cplans/basic_101.cplan" 
      parameter "Vendor"
      dimension "Product Name" 
      text column = "Cases" { 
        value-format "#,###.00" 
      } 
    } 
  } 

See also:

Mentioned in: