cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports - Apply formula to crosstab

Former Member
0 Kudos

Hi,

I would like to add a formula based on the below cross tab.

I want to manually increase the 2018 value (e.g. 7,842,095 + 500,000), but I want the remaining years to return the current value (so I don't want the formula applied to earlier years).

Is this possible to do?

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Elisa,

Right-click one of the summary cells under the "Total" column > Format Field > Click the formula button beside 'Display String' and use this code:

IF GridLabelAt("Row Field", CurrentRowIndex) = 2018 then 
totext(CurrentFieldValue + 500000,0,',') 
else totext(CurrentFieldValue,0,',')

Replace "Row Field" with the correct database field used as the Crosstab's Row. Also, ensure that the field name is surrounded by double quotes and not curly braces like above.

-Abhilash

Former Member
0 Kudos

Hi Abhilash - thanks for the response!

Below is a screenshot. I inserted the database field as you mentioned above. However, it's a date field that is formatted by year in the crosstab, so I'm getting an error. I also tried typing year(tzzcrm1111600.t_cldt), but that did not work.

Any suggestions?



abhilash_kumar
Active Contributor
0 Kudos

Hi Elisa,

Try using the Year function outside the GridLabelAt function. Like so:

IF Year(GridLabelAt("Row Field", CurrentRowIndex)) = 2018 then 

-Abhilash