Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Combination Calculations Post Reply Post New Topic
Author Message
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Topic: Combination Calculations
    Posted: 04 Nov 2013 at 5:47am

Dear All,

Can someone help me with following issue:

I have a report which contains data about orderlines within an order.
Report has a Group Header1 on Orderlevel.


For Example:

Order 1:
order 1 line 1 ProductGroup X
Order 1 line 2  ProductGroup Y
Order 1 line 3 ProductGroup Z

Order 2:
Order 2 line 1 ProductGroup Y
Order 2 line 2 productGroup Z

Order 3:
Order 3 line 1 ProductGroup X
Order 3 line 2 productGroup Z


I want to create a matrix which tells me how many orders are occurring in a certain combination of 2 Productgroups?

                         ProductGroup X  ProductGroup Y  ProductGroup Z
ProductGroup X              2                     1                      2   
ProductGroup Y              1                      2                      2
ProductGroup Z              2                      2                      3

So, if you look to the example data:
Productgroup X with productgroup X has 2 orders.
Productgroup X with productgroup Y has 1 order.
Productgroup X with productgroup Z has 2 orders.

I tried with a crosstab but could not get the desired result.
i have approx. 30 productgroups.

Does anyone have an idea how I can solve this?

regards
Memoli
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 Nov 2013 at 4:46am
this is an odd way to look at things...odd in that it is not how reporting systems tend to work.

I can see doing it as running totals or shared variables, but it would get quite messy / be a maintenance nightmare.

What would probably be the easiest to and most maintainable would be to create your output datatable using a stored procedure as SQL can look at each order as a group where-as crystal looks at each line individually.

HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.