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

Group Formula Syntax

Status
Not open for further replies.

ReillyC

MIS
Feb 6, 2004
114
US
I need more help.
I'm looking for the proper way to write a group formula.
I've create three groupings.

1. TV
2. DVD
3. Radio

In each grouping I have several different companies names
so in the TV group we can have Sony, Panasonic, Sanyo
in the radio group : Sony, Sanyo
in the DVD group: Sony, Panasonic and Hewlett.

I'd like to place this group formula in the running total reset field but I'm not sure how to properly write the syntax. Please help.

Thanks for your help! :)
 
This looks like one group, maybe based on a field like {table.electronicequipment}, with three instances: TV, Radio, DVD. If this is the case, then the reset would just be "On change of group" and you would select the Electronic Equipment group.

If this isn't what you mean, you should provide information about what you are trying to do, along with sample data.

-LB
 
I'm counting the number of agreements we have in each of the groupings TV, DVD and radio. Note the groupings do not exist in the database.

We have a table in the database with company names, i.e.{table.company}.

Each company signifies a different product importance. Each company can be repeated many times along several groups i.e. Sony and Sanyo



TV DVD Radio
Sony Sanyo Sony
Sanyo Mitsubshi Panasonic
Panasonic Hewlett


In the summary field I have count licensing number which is alphanumeric.

In the evaluate field I have evaluate each reord.

In the reset field I would like to place the a formula to signify the different grouping types TV, DVD, Radio.

I hope I've been more clear. Thanks.:)

 
What does this mean: "Note the groupings do not exist in the database."

What field or fields give you the results: TV, Radio, DVD?

-LB
 
In the crosstab a user can create groupings that do not exist in the database. I was trying to do they same thing via formula.

Thanks.
 
Again, what field or fields give you the results: TV, Radio, DVD?

-LB
 
The table which contains the company names. {table.company}

TV = Sony, Sanyo, Panasonic
DVD = Sanyo, Mitsubshi
Radio = Sony,Panasonic,Hewlett

I hope I understand. Thanks.


 
Are you saying that there IS no field that gives these results, and that you want to call clusters of companies by these names? I don't think you can create an ordinary group field because you want to the same company to appear in different groups, but you could do a manual crosstab by creating three separate formulas:

//{@TV}:
if {table.company} in ["Sony","Panasonic","Sanyo"] then 1 else 0

//{@DVD}:
if {table.company} in ["Sony","Mitsubishi"] then 1 else 0

//{@Radio}:
if {table.company} in ["Sony","Panasonic","Hewleett"] then 1 else 0

Place these formulas in the detail section, along with the field for license number. Then right click on each formula and insert a summary (SUM, not count). Then suppress the detail section. This should give you a display like:

TV DVD Radio
12 34 23

If you want to display the detail section with the company names under each heading, then create formulas like:

//{@TVcompanies}:
if {table.company} in ["Sony","Panasonic","Sanyo"] then {table.company}

Repeat for DVD and Radio. Place these in the detail section under the correct heading.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top