Skip to main content
Skip table of contents

Record Count

The record count plugin calculates the number of records contributing to a result, including any records with null values.

It is designed to be used in conjunction with other Data Control modules. For example, it can be useful if you are writing your own Data Control API module and need to obtain the record count.

Example Usage

The following example shows how to configure the record count plugin.

method addmethod <method_id> mandatory <display_name>
method <method_id> common addproperty FREQ TRUE
method <method_id> common addproperty CELL_ERRORS TRUE
method <method_id> adddcplugin recordcount recordcount 1

The cube containing the values is called RECORD_COUNT. You can then use this as input to another data control module, such as the perturbation module (as shown in the following example).

Conceal Related Summations when using Perturbation

If you are using perturbation, then you may want to use the record count plugin in conjunction with the perturbation and confidentiality plugins to conceal related summations.

One example of a scenario where this might be required is if perturbation is enabled and the user adds both a record count and a summation (such as the mean) to the table. The count might be perturbed to zero but the mean might be non-zero, which tells the user that the record count is really not zero.

The following example configuration hides summations when the record count has been perturbed to zero.

  1. Login to SuperADMIN and create a new mandatory method:

    > method addmethod "PerturbationMethod" mandatory "Perturbation with Suppression of Associated Measures"

    In this example, the method ID is "PerturbationMethod" and the display name is "Perturbation with Suppression of Associated Measures", but you can set these to whatever values you prefer on your system.

  2. Set the following common properties for the method:

    > method "PerturbationMethod" common addproperty RKEY "true"
    > method "PerturbationMethod" common addproperty RKEYWANTNULLS "true"
    > method "PerturbationMethod" common addproperty FREQ "true"
    > method "PerturbationMethod" common addproperty CELL_ERRORS "true"
  3. Add the perturbation and record count Data Control plugins to the method:

    > method "PerturbationMethod" adddcplugin recordcount recordcount 1
    > method "PerturbationMethod" adddcplugin perturbation Perturbation 2

    It is important to set the priorities of the two plugins so that the record count plugin is applied first.

  4. Add a property to the perturbation plugin that instructs it to perturb the results of the record count:

    > method "PerturbationMethod" perturbation addproperty RULESET "PERT()|PERT(true,RECORD_COUNT)"
  5. If there are other properties you want to set for perturbation, specify them now in the usual way:

    > method "PerturbationMethod" perturbation addproperty <property_name> <property_value>
  6. Finally, add the confidentiality plugin to the method (with the priority set to 3, so it is applied after the other two plugins), and configure it to conceal cells based on the perturbed record count:

    method "PerturbationMethod" adddcplugin confrule confidentialityrule 3
    method "PerturbationMethod" confrule addproperty RULESET "FREQ(0,RECORD_COUNT)"

You can now apply your completed method to your databases in place of your existing perturbation method.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.