Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Distinct sum Post Reply Post New Topic
Author Message
kezza
Newbie
Newbie


Joined: 08 Mar 2012
Location: Netherlands
Online Status: Offline
Posts: 19
Quote kezza Replybullet Topic: Distinct sum
     Posted: 10 Jun 2013 at 1:45am
Hello everyone,

I'm getting stucked on the following issue.
I have a report with groups on customer/order/article.
now I want to show the stock of all articles on customer level. So for Customer "X" we have a total of 200 pieces on stock.

But I can't do a normal sum because some articles have more then one entry in different orders.
When Article 1234 has a stock of 200 and this article is shown up in 2 orders of the customer than I get a total stock of 400 instead of 200.

I've tried running formulas but don't get the trick. Can someone help me please. Thanx.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jun 2013 at 3:46am
please show some sample row level daat as it is grouped and how you need it to end up
IP IP Logged
kezza
Newbie
Newbie


Joined: 08 Mar 2012
Location: Netherlands
Online Status: Offline
Posts: 19
Quote kezza Replybullet Posted: 10 Jun 2013 at 4:10am

customer info:
--------------
customer id: 1234
customer name: test
Total items on stock: XXXXX

order info:
-----------
ordernr : 0001
total order amount: 1000,-

product info:
-------------
itemcode : 9999
itemdescription: USB STICK 2GB WITH LOGO CUSTOMER1234
on stock : 200


This is how the report is set up. What I want is a summary of the total stock for products for customer 1234 (see XXXXXX above).

The issue is that itemcode 9999 can also exist in more orders of customer1234. So when I make a summery on article.stock I must get 200 because that is the actual stock but I get 400 (when i have 2 orders with this article).

Get the idea ?
Thanx in advance.

Edited by kezza - 10 Jun 2013 at 4:15am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jun 2013 at 7:40am

can you just use a maximum ?

are you just trying to show the total on stock or the difference between what is on stock and what is ordered?
does one oder trump another?
what if the on stock is > the # ordered?
IP IP Logged
kezza
Newbie
Newbie


Joined: 08 Mar 2012
Location: Netherlands
Online Status: Offline
Posts: 19
Quote kezza Replybullet Posted: 10 Jun 2013 at 9:27pm
I can use a maximum but also then I need to summarize these maximums of the different stock amounts.

items customer x
----------------
itemnr. 1234, stock 200
itemnr. 5678, stock 100

Total amount of stock for customer X = 300

300 is the amount I want to show in the debtor info (see top of topic).
IP IP Logged
kezza
Newbie
Newbie


Joined: 08 Mar 2012
Location: Netherlands
Online Status: Offline
Posts: 19
Quote kezza Replybullet Posted: 12 Jun 2013 at 9:54am
I've solved it with an extra view in SQL.
Thanks anyway.
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