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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to group by formula

Status
Not open for further replies.

julave

Programmer
Nov 14, 2003
13
AT
This is my problem: I created a invoice report for a building firm, which should either be grouped by delivery ticket number, by delivery address or by building site.

how can i do this? and which formula?

in my dataset i have a field (integer) called "invoicetype" which should be decisive for the grouping field. f.e. 1 for group by deliver ticket number etc.
 
Create a formula similar to the following:

Select {Table1.InvoiceType}
CASE 1:
{Table1.DeliveryTicketNumber}
CASE 2:
{Table1.DeliveryAddress}
CASE 3:
{Table1.BuldingSite}
DEFAULT:
{Table1.SomeField}

The only limitation is that each of the above fields have to be of the same data type. So, if the Delivery Ticket Number is numeric and the address is string, you'll need to convert the Ticket Number to text, as in:

ToText({Table1.DeliveryTicketNumber},0,"")

(the last two arguments being 0 decimals and no comma displayed in the thousands separator)

This will categorize each record according to the invoice type. Group on this formula field and you should get the result you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top