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

Interesting Grouping Problem 1

Status
Not open for further replies.

zivrap

Technical User
Aug 10, 2004
31
CA
Hi All,

I have a problem that I cannot figure out. I have the following table.

Code:
Monthly Totals
---------------
company name (PK)
month (PK)
car sales
budget car sales
SUV sales
budget SUV sales

I want a report that looks like follows...

Code:
Company Name 1
                car sales   budget car sales     month
               -----------  -----------------   -------
                  100             50              Jan
                  200             100             Feb
                   ..              ..              ..

                suv sales   budget suv sales      month
               -----------  -----------------    -------
                  75             65               Jan
                  56              55              Feb
                  ..             ..                ..

Company Name 2
                car sales   budget car sales
               -----------  -----------------   
                  400            100             
                  500            300             
                   ..              ..              

                suv sales   budget suv sales 
               -----------  -----------------   
                  300            200               
                  150            400             
                  ..             ..

I have a group on the company name, but I cant figure out how to split up the fields into two separe "tables". I tried inserting another detail section in my report but that overlapped values instead of seperating them. I am using cr 8. Thank you all very much for the help.


 
Why do you want seperate tables? I'll assume that you have the monthly sums already in a single field per month and that sums aren't required.

Why doesn't Company Name 2 have month info?

Group by the Company, then by the Month (looks like your month is alpha, so the sort will be wrong, you can either code a formula for this, or use the Options Use Specified Order, or go swat your dba out the window and hire a real one to handle table design and use a date field like any reasonable person would.

The design is very different from how most might like to see this sort of information, it's counterintuitive not having data alongside.

You might just create a subreport linked by the Company and Month, and then have the main report show the company and months for the car sales and t car sales, and the subreport would have the others.

Place the subreport in the Company Group Footer.

Then just place the appropriate fields in the month group footers f the main and subreport.

-k
 

Thank you for the help !! I tried your suggestion and it worked! To answer some of your questions: Company Name 2 does not have month because I forgot to put it in when I was typing the example; sorry. And you are also right that sums are not required.

The report might seem counterintuitive, but I think it seperates things into logical groups. You ony want to compare car sales with car budget...suv sales with suv budget etc...it is my opinion that it is cleaner to have them seperate rather than all side by side. Or can you think of an even cleaner way to do this ?

Thanks again.
 
Well you could have just dumped it all in a Cross-Tab, grouped by Company and Month, but the formatting doesn't leave nmuch room for creative play.

Glad that it worked.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top