Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Cross-Tabs and Groups Post Reply Post New Topic
Author Message
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Topic: Cross-Tabs and Groups
     Posted: 06 Jun 2013 at 5:25am
So I have two ables.
 
For each ID in table 1, I have multiple records in table 2 that have item-level detail for orders.
 
So from table 1 I need some data, and then from table 2, I need other data, both summed.
 
The problem is that for an ID, lets say ID 1, if there are 3 corresponding values in table 2, and I want to sum a field in ID 1, the cross-tab triples the dataset, pulling in that same value 3 times once for each corresponding value in table 2. But table 1 only has it once, so its only meant to exist once.
 
In normal crystal I can use groups to group these together and then move the details to the group footer. But not sure how to handle this with cross-tabs, any ideas?
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 07 Jun 2013 at 5:26am
Hi


This should be resolved using table joins.

If you want to pull only one value for each ID, then try to use Maximum()as your summry i.e. in summarized fields change the summary to Max insted of sum

Thanks,
Sastry
IP IP Logged
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Posted: 07 Jun 2013 at 11:29am

I have tried all the possible table joins, can't seem to get it to change anything.

The problem with using max is that I need to sum the IDs by date ranges. So I need to essentially sum the max of the IDs values, if that makes any sense.
 
I can pull it all out manually and do it, but I have to repeat this report dozens of times a month every month so want to get it as automated as possible.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 10 Jun 2013 at 4:00am
Hi
 
You said :
 
"The problem with using max is that I need to sum the IDs by date ranges. So I need to essentially sum the max of the IDs values, if that makes any sense."
 
If you want to make summary of all your max values, then try to get the max value from tables i.e. through free hand SQL.  Use add command and write your own SQL which will pull only one max value into report then you can sum it at report level.
 
Ex : Select ID, DATE, MAX(AMOUNT) FROM TABLE1,TABLE2 (Join according to your requirement) where condition
GROUP BY ID, DATE
 
Hope this helps
Thanks,
Sastry
IP IP Logged
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