SAP Knowledge Base Article - Public

2141652 - How to retrieve the group hierarchy level in a crosstab summary cell in Crystal Reports

Symptom

  • We want to retrieve the group hierarchy level (as a context information) in a crosstab summary cell in order to show / display the breakdown summaries for different group levels.
  • The respective formula group "Grid value" is only shown in the formula editor when an embedded summary field is inserted and being edited.

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2011

Resolution

1. Create a crosstab with 2 or more columns.

 crosstabExpert.png

crosstab.png

2. Create a new embedded summary.

1.png

3. Right click on "Edit this formula" -> Embedded Summary -> Edit calculation formula.

2.png

4. In the formula expert find the function group "Grid Value".

3.png

5. Use "GetColumnGroupIndexOf(CurrentColumnIndex)" formula to get back the hierarchy level.

 4.png

6. The result will be the hierarchy level as a number (starting from 0 for the grand total). You can use this with "if" clause to show different results in for each hierarchy level for example.

5.png

Keywords

crosstab hierarchy level group crystal reports report designer 2011 2013 currentcolumnindex getcolumngroupindexof grid value display , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , How To

Product

SAP Crystal Reports 2011 ; SAP Crystal Reports 2013