cancel
Showing results for 
Search instead for 
Did you mean: 

How to group by the value represented in the field, not the field itself in Crystal Reports

0 Kudos

I have 10 fields in my table that represent year 1-year 10. I want to group a report by the year represented in the field, not by the field itself. For example, one result may look like this:

...and so on

The next result may be:

I want to group by the year, so that I can sum quarterly amounts for each year (i.e. 2023, 2024, etc.) This is a simple, one table report that needs to sum amounts for each quarter of each year for a couple hundred results.

I have tried creating a formula to parse out the year, but can't figure out how to group by the year value and not the field since there are 10 different year fields.

DellSC
Active Contributor

I may be able to give you a Command (SQL Select statement) that will give you what you're looking for, but I need to know more about the table. Can you provide the structure/fields of your single table? Are they all varchar/string fields? Are the above two tables a representation of the data that's in it or is the second one a view of what you're looking for?

-Dell

0 Kudos

So when I say it is "simple", I meant that there is only one table and no table joins happening. The table I am pulling from has 100+ fields of varying field type (string, number, datetime). However, this report only concerns string and number fields from that table. The year is a string, the quarterly values are numbers.

The above table is what I'm trying to use the data from the SQL table to create in Crystal. Does that make sense?

Accepted Solutions (0)

Answers (0)