Skip to Content

Using distinct count in Crystal crosstab

Mar 09, 2017 at 10:20 PM


avatar image

Hi friends,

I need to create crosstab in Crystal for group distinct count distributed by month.

Iam using Numer variable to calculate the total. But this formula is not available in crosstab expert . Is there any way to use distinct count formula in crosstab?

This is a report:

GH1: January 2017





GH2: February 2017




This is the crosstab:

Jan-17.... Feb-17 .... Total

2........... ..1 ............... 3

I would appreciate any help on this.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Abhilash Kumar
Mar 10, 2017 at 10:31 AM

Hi Alisia,

Here's what you need to do:

1. Right-click the Total Column header > Calculated Member > Insert Child.

2. A Blank Column with zero values is inserted at the start.

3. Right-click the blank white space to the top left of the crosstab > Advanced Calculations > Calculated Member > For 'Insert Evaluation', select 'After'.

4. The blank column should now move to the end just before the original Total Column.

5. Right-click the blank column's header cell > Calculated Member > Edit Header Formula and type in:


6. Right-click one of summary cells in this calculated column > Select Calculated Member > Edit Calculation Formula > Use this code:

local numbervar i;
for i := 0 to CurrentColumnIndex-1 do
    local numbervar t := t + GridValueAt(CurrentRowIndex, i, CurrentSummaryIndex);

7. Right-click the original Total Column at the end > Select Column Grand Totals > Suppress Grand totals.


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you a lot Abhilash!