Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: CR crashes with 3 tables and no results with 2 Post Reply Post New Topic
Page  of 2 Next >>
Author Message
katie1200
Newbie
Newbie


Joined: 29 May 2009
Online Status: Offline
Posts: 23
Quote katie1200 Replybullet Topic: CR crashes with 3 tables and no results with 2
    Posted: 25 Jun 2009 at 5:01am
hi all,
 
i am having a problem (one of many lol) i will try my best to explain in detail.
 
i have to make a sales report (CRXI) with individual product sales totals. now the problem arises when sales reps discount a product to €0.00 so it can be given as free stock. 
this is throwing my sales totals out saying they have sold more than they have. i am adding it by quantity because the cash figure is not what is required.
 
database example:
 
quantity      item          rep      customer        price
 
      3           milk           bob          1111            23
      6           wine          gill           2221            45 
      3           milk          paul          3333              5
      1           pen          paul          3333              0
 
i have used the select expert and tried to return values
if(price is not equal to 0) 
i have also tried setting it between values and greater than but i get then same result.
 
any products that had a sale set to zero are not showing up in the grouping on the side. They are grouped by rep then by product description then by item code. When i take out that statement the product reappears in the grouping but the sales total is wrong.
 
i thought maybe there was a problem with the field so i triedadding another table with a cost field that would also be set to zero and when i try to do anything it just crashes crystal.
i have looked at how i link the tables and they are all linked by the same key which is product code and this is a primary key in two of the tables and just a field in another!
 
please help!!
 
sorry for the long post i thought it best to be descriptive, thanks again for any help given.
 
Katie.
 
 
 
 


Edited by katie1200 - 25 Jun 2009 at 5:09am
IP IP Logged
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Posted: 25 Jun 2009 at 6:11am

Hey Katie,

Don't realy get the problem as in what you are count and what is not beying counted (maybe some later reply from somebody else is more usefull)
For now i can only sudject to change the "zero" value's to value + 0.00001 for example
this is a very small impact in your totals and witch a 0.xx max value behind the 0. it will not be visual unless you have 500+ sales of that article.
 
hope this helps a bit.
 
Greetz
 
Adam
IP IP Logged
katie1200
Newbie
Newbie


Joined: 29 May 2009
Online Status: Offline
Posts: 23
Quote katie1200 Replybullet Posted: 25 Jun 2009 at 6:20am
hi adam,
 
i am counting the quantity amount but with every transaction be it a normal sale for cash or a zero sale for free stock there is always a quantity so i need to only count the actual sales as oppesed to evry transaction.
i cant change any figures in the data base there are hundreds of sales every day and the prices are set so i have no access to them.
 
thanks for input
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 25 Jun 2009 at 6:25am

Why are you selecting based on price?  You want entries where the price is 0 don't you?  The report must be comparing to some other field to be able to say that you sold more than you have.

Wouldn't this be an issue of looking at quantities and not at price?
IP IP Logged
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Posted: 25 Jun 2009 at 6:29am
Hey Katie,
 
so if i understand correct you have somthing like
 
article   /    amount on invoice /   cost / customer /  rep
 
and you want to count the "amount on invoice" for every article where the cost is <> from 0 ?
 
Adam
IP IP Logged
katie1200
Newbie
Newbie


Joined: 29 May 2009
Online Status: Offline
Posts: 23
Quote katie1200 Replybullet Posted: 25 Jun 2009 at 6:39am
yes when "amount on invoice" in my problem is called quantity e.g. a crate of beer. the report would total how many crates of beer were sold not the cash price of how much beer was sold.
 
IP IP Logged
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Posted: 25 Jun 2009 at 6:46am
Hey Katie,
 
sorry but i'm not completly with you
 
could you make a small example with like above some numbers and articles and what you get now and what you would like to get ?
so i exatly see what totals you get now and what you would like to get.
 
My english isn't that great that's why i'm not 100% what you now get and where you want to get to.
 
greets
 
Adam
IP IP Logged
katie1200
Newbie
Newbie


Joined: 29 May 2009
Online Status: Offline
Posts: 23
Quote katie1200 Replybullet Posted: 25 Jun 2009 at 7:24am
before i use price <> 0
 
i get this
 
 
quantity      item          rep      customer        price
 
      3           milk           bob          1111            23
      6           wine          gill           2221            45 
      3           milk          paul          4534              5
      1           pen          paul          3333              0
      1           pen          paul          3333              6
 
after i use price is <> 0
 
i get
 
      3           milk           bob          1111            23
      6           wine          gill           2221            45 
      3           milk          paul          4534              5
 
the pen sale just disappears!
 
thank you for trying to help especially if you dont have great english.


Edited by katie1200 - 25 Jun 2009 at 7:33am
IP IP Logged
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Posted: 25 Jun 2009 at 7:47am
Hey Katie,
 
No problem @ all
 
the price <> 0 are you doing this on the detail lvl ?
normaly as far as i know this can't be happening if you do the
price <> 0 on the sectie formula / record
 
      3           milk           bob          1111            23
      6           wine          gill           2221            45 
      3           milk          paul          4534              5
      1           pen          paul          3333              6
 
This is what you should get if you do price <> 0 on the record lvl
if you do this on the group lvl there is somthing else wrong
 
Greets
 
Adam
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Jun 2009 at 8:05am
I'll throw my two cents in.
I'll hazard a guess that when you use the select statement of price <>0 it is either making a left join into an inner join or dropping extra values from an extra link somewhere along the line. I doubt it is coincidenta that your item and customer are the same for oth items that were dropped.
 
That being said you should be able to easily get your numbers using Running Totals that conditionally count or sum your fields where table.price <>0 without worrying about dropping records via the select statement.


Edited by DBlank - 25 Jun 2009 at 8:05am
IP IP Logged
Page  of 2 Next >>
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.014 seconds.