Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you group crosstab rows by formula?

Status
Not open for further replies.

slugovsky

Programmer
Dec 27, 2001
1
US
Off from the start, I apologize for how simple the answer to this is probably going to be, but its been frustrating me for a while now so here goes. Simply put: how do you group rows in a crosstab report by formula? Right now I have a situation where the row groupings are by ID# range and it works well when you specificy group by field, and then in group options pick specified order, and define the ranges. It works great. However, the range changes with each database update (the max of the column - a constant), and I wrote a simple formula to select the appropriate range based off of the max of the ID column. Formula seems to be fine. However, in the group options there is no where that I can select this formula to group by. You only get the three options: Specified order, ascending and descending. And in specified order you get between, greater than, less than, etc. and no "formula: " option. What am I missing?? Any help is greatly appreciated.

 
You can use most formulas for cross-tabs, but you can't use any formula that uses a summary operation, like MAX.

What is the actual formula you are using? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
You could use a subreport technique, but you have to turn it upside down.

1) In your main report, get the data and find the max of the range you want. (and do very little else)
2) Create a subreport which is based on your original report. This can go in the report footer of your main report.
3) Pass the range formula down to the subreport as a paramater. You can use that in your crosstab.

There would also be a solution using SQL and a vieww with your summary function already calculated.
Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top