cancel
Showing results for 
Search instead for 
Did you mean: 

CrossTab Puzzle

Former Member
0 Kudos
58

I have a Crosstab that I have gone as far as I can tell toward the goal; and I would appreciate your experience if you have solved one of these two problems.

#1 On a crosstab the requirement is that I have additional calculated columns in the Grand Total Column based on the totals. Such as the profit below which would be Sales X Profit% = $210,000 X 0.60 = 12.60.

Product Sale Price Profit Jan Feb Maru2026 Nov Dec Profit Total

Cardinals Tickets [ 6.0%] 50,000 66,000 77,000 15,000 2,000 [12,600] 210,000

Cardinal Ball Caps [2.0%] 2,000 8,000 18,000 9,000 3,000 [800] 40,000

#2 The profit percentage printed in the end of the row title. I had this worked out at one point and have lost it since.

vbwrangler

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi,

If you're using Crystal Reports 2008, look for Grid functions in the help (F1).

To make life a l'il easier, lets start off anyway.

1) To insert a new column(Profit) before the Grand Total column, right click on the second to the last col (Dec in this example) and select Calculated Member > Insert Column

2) A column with zero values and a blank header comes up

3) Right-click the empty header and select Header Formula. To show the col name as profit, just type in "Profit"

4) Right-click the header again and this time select Edit Calculation Formula. Here you would need to know the column index of the Profit column. The col indexes start from zero. In the example I can see that Profit is the 4th col or the 3rd (I'm not sure ), so assuming it is the 4th col, the col index would be 3

5) Go to the Calculation Formula and type in this formula:

gridvalueat(currentrowindex,currentcolumnindex+1,currentsummaryindex) * (gridvalueat(currentrowindex,3,currentsummaryindex)*0.10) //Here currentcolumnindex+1 is the Grand total col

I didn't quite get the 2nd point. Anyway, let me know how this goes!

-Abhilash

Former Member
0 Kudos

Abhilash

Thank you for taking the time to answer; however the solution and the link you sent related to an OLAP grid prior to pivoting it. My table is a CrossTab to begin with. You cannot right click on a column and get anything more that the column label. The data I displyed for the question was a simplification but the priciple should be the same. The [ ]'s show the data required.

JULY VOLUME AUGUST VOLUME SEPTEMBER VOLUME Total

1021010100028

ROOM SEMIPRIVATE IP ChgWt 0.00 35.00 0.00 [14] 35.00

OP [ 2.5] 0.00 70.00 0.00 [28] 70.00

Total 0.00 105 0.00 [42] 105.00

1021024100025

ROOM SEMIPRIVATE IP ChgWt 2.00 8.00 2.00 [6] 12.00

OP [2] 1.00 7.00 0.00 [4] 8.00

Total 4.00 12.00 2.00 [9] 18.00

Former Member
0 Kudos

Abhilash

I forgot to add I am using CR 2008. I tried to follow all your suggestins and menus did not quite match up, nor did it work.

Vbwrangler