IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Group By a computed field
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<Leah Bell>
Posted
I am trying to group by a computed field. I have two fields from a table that I concatenated as a compute. Now I need to group by on that new concatenated field. I am getting the error message that you can't sort or group by on a computed field in report painter. Is there a work around? Can you group by on it if it is set up as a define?
 
Reply With QuoteEdit or Delete MessageReport This Post
Guru
Posted Hide Post
You cannot just simply do a BY on a COMPUTEd field because of when it is created. You will need to use a BY TOTAL if you don't want to move the COMPUTEd field to DEFINEd field or if you don't want to create hold file.

TABLE FILE CAR
SUM
SEATS
COMPUTE SEATS_P/I6 = SEATS + 1;
BY COUNTRY
BY TOTAL LOWEST SEATS_P
BY CAR
END
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Reply With QuoteEdit or Delete MessageReport This Post
Guru
Posted Hide Post
It is correct that you cannot do a straight BY on a COMPUTEd field. You must do a BY TOTAL. In the report painter, right click on your computed field and choose ORDER REPORT BY.

Is SORTing BY the concatenated field all you want to do?

If you want to do
BY fldname IN-GROUPS-OF
then you would have to do this as a DEFINE field or perhaps create a hold file with your COMPUTEd field and then group it in a second step. It will depend on the kind of performance that you are getting on your report.

If you are reporting against an RDBMS it might be better to pull the data and concatenate as a COMPUTE and do the GROUP-BY in a second step.
 
Posts: 342 | Location: Melbourne Australia | Registered: April 15, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Group By a computed field

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.