bindingInfo.setTopNReverse(field, header, Boolean)

Specifies whether groups are selected from the top or bottom of the ranking according to the given measure. When true, this is equivalent to selecting ‘Bottom’ in the ‘Ranking’ menu in the Crosstab Editor. When false, this is equivalent to selecting ‘Top’ in the ‘Ranking’ menu in the Crosstab Editor.

bindingInfoSetTopNExp3

This function should always be used in conjunction with bindingInfo.setTopN(field, header, number) and bindingInfo.setTopNSummaryCol(field, header, measure).

Parameters

field

String: Name of a column to rank

header

StyleConstant.ROW_HEADER or StyleConstant.COLUMN_HEADER

Boolean

true for 'Bottom', false for 'Top'

Example

Crosstab1.query = 'Sales';
Crosstab1.bindingInfo.rowFields = ['Name'];
Crosstab1.bindingInfo.colFields = ['Region'];
Crosstab1.bindingInfo.measureFields = ['Total'];
Crosstab1.bindingInfo.setFormula('Total', StyleConstant.SUM_FORMULA);
Crosstab1.bindingInfo.showColumnTotal = true;
Crosstab1.bindingInfo.setTopN('Name',StyleConstant.ROW_HEADER,3);
Crosstab1.bindingInfo.setTopNSummaryCol('Name',StyleConstant.ROW_HEADER,'Sum(Total)');
Crosstab1.bindingInfo.setTopNReverse('Name',StyleConstant.ROW_HEADER,false);

bindingInfoSetTopNExp1 2

Either syntax below can be used in component script:

bindingInfo.setTopNReverse             // unqualified
Crosstab1.bindingInfo.setTopNReverse   // qualified

For onInit/onRefresh scripts, and for component and property scripts on other components, the second (qualified) form is required.