How to get rid of cartesan product in report (1 Viewer)

vsap

vsap
Local time
Today, 02:30
Joined
May 27, 2005
Messages
29
Hello Guys,
I have a report in that there id #(text field),place order #(number)is customer name column and it has multiple orders(event column) ,now this multiple orders get repeated for the customers which has common orders.
Eg: custid,place order#,customers name,order name
A,1,jon,shirts
A,1,jon,socks

A,2,jon,shirts
A,2,jon,socks
A,2,jon,shoes

B,1,sam,shirts
B,1,sam,socks

B,1,andy,shirts
B,1,andy,socks
B,1,andy,ties

B,1,tom,shirts
B,1,tom,pants
What I m getting is cartessan product
A,1,jon,shirts
A,1,jon,socks

A,2,jon,shirts
A,2,jon,socks
A,2,jon,shoes

B,1,Sam,shirts
B,1,Sam,Socks
B,1,Sam,pants
B,1,Sam,ties

B,1,Andy,shirts
B,1,Andy,socks
B,1,Andy,pants
B,1,Andy,ties

and it repeats for tom too

Report user wants o/p
custid,place order#,customers name,order name
A,1,jon,shirts
A,1,jon,socks

A,2,jon,shirts
A,2,jon,socks
A,2,jon,shoes

B,1,Sam,Shirts
B,1,andy,socks
B,1,tom,ties
---------,pants
---------,brush
so dont want to repeat customer name and order name.is any grouping problem in the report layout,any suggestion is welcome.
So how should I get it please let me know.

Thanks
vsap
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:30
Joined
Feb 28, 2001
Messages
27,317
Cartesian products occur when you reference two tables in the same query and fail to specify or incorrectly specify the field across which the two tables have a relationship. Which begs the question, does a declared relationship exist between the involved tables?

Basically, this is a failure to have a valid JOIN clause in a multi-table query, with all the things that a JOIN implies.
 

vsap

vsap
Local time
Today, 02:30
Joined
May 27, 2005
Messages
29
Thanks for reply,but how to get it as user wants.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:30
Joined
Feb 28, 2001
Messages
27,317
build a query (including proper joins) that contains all the summary AND detail information that you need.

Then use the report wizard, which will ask you how to order the report. Let it build you the report with breaks on customer name.

OK, now before you deploy the report, go back and customize what was built. Here's a little secret for rapid report deployment. Let the wizard build your foundation; then you can go back and customize it.

So if you don't want customer name or ID to repeat, put them as fields in the customer group header. Remove them from any detail-section records.

If you want to sub-break on purchase-order number, again you can remove the PO number from the detail and put it under the PO number header section.

If you are not sure, read up on reports in your help files; in particular, read up on group headers and group footers.

If you want sub-totals, they go in the PO or customer footers. Or both, as needed.

If you want a grand total, you need to put that in a report footer section.
 

Users who are viewing this thread

Top Bottom