Click to See Complete Forum and Search --> : Cross Tab Crystal 11 Prob


Bill Crawley
November 17th, 2008, 10:43 AM
Hi All,

I have a cross tab that I create from a Stored Proc (SQL Server).

The Columns of data with Header are all fine. The Row name takes on the value of the column name from the DB. So For example:

USA Uk
Previous_Month_1 10.00 20.00
Previous_Month_2 5.00 15.00
etc

The problem that I have is that I can hard write over 'Previous_Month_1 with say "October", but I need this to be in a formula since the value's will be rolling. How can I force a formula in this section. The Cross tab is in the Report Header section of the main report.

Ned Pepper
November 17th, 2008, 02:47 PM
You would use two formulas: one to get the month's numeric value for sorting and grouping, and another for displaying the month's name. You will need the functions
month()
monthname()
currentdate()
dateadd()
tonumber()
mid()

Get the last character of the field which contains "Previous_Month_X, convert it to a number and and use it in the dateadd to get the month number (negative adding for previous months). use that formula in your cross tab row grouping, and use the grouping options to dispany the MonthName of the grouping formula.