Mike
Mike

Reputation: 743

Crystal report percentage difference between 2 columns in crosstab

Not sure if this is possible or not in crystal. I have a crosstab report that has 2 columns. I need to take the percentage between the 2 values. Here is a quick sample of what I need it to look like:

              Type 1       Type 2       Type 3        Total
              ==========   ==========   ==========    ==========
3/1/2011      2  1  50%    1  1  100%   0  0   0%     3  2  66%
3/2/2011      1  1  100%   3  1   33%   5  3  60%     9  5  55%
Total         3  2  66%    4  2   50%   5  3  60%     12 7  58%

To create column 1 I am just doing a distinct count. To create column 2 I created a formula to the field value to 1 if it is true and 0 otherwise. I set the 3rd column to take the percent by row. The problem is in the row total at the bottom. The counts are correct, but the percentage always shows up as 100%.

I am using crystal reports 2008.

Upvotes: 2

Views: 3803

Answers (1)

Mike
Mike

Reputation: 743

I was able to finally figue this out.

In column 1 I added a distinct count. Column 2 I added a count based off of a formula: if MyType = "Whatever" then 1 else 0

The third column was an average (a built in function).

No groupings are needed.

Upvotes: 2

Related Questions