Joined: 23 Oct 2011
Online Status: Offline
Posts: 4
Topic: sub total Posted: 24 Oct 2011 at 7:33am
Hallo,
I'm new with crystal reports and have a problem with the sub total of my report. We are using a btrieve database and crystal repots 2008.
In de database we have data about food recipes. I'm using the 2 tables which are linked with a join left outer. In the first table i have the recipenumber and their weights and in the other the base materials and weights which we are using in the recipes. When i select the recipenr and amount i get a total of 21,02 kg. That's correct
Recipenr weight 14525 chicken/onion 20,00 9675 rice/sauce 1,02 total 21,02
But when i select the base materials to the reports the total is changing incorrectly
Recipenr weight base materials in recipe weight 14525 chicken/onion 20,00 chicken 10 14525 chicken/onion 20,00 onion 5 14525 chicken/onion 20,00 jus 5 9675 rice/sauce 1,02 rice 1
9675 rice/sauce 1,02 sauce 0,02 total 62,04 Must stay 21,02
I tried to group the recipenr but everytime when i add the base materials to the report the total is changing.
Are there some tricks or formulas to count the weight of the recipenumber 1 time instead of copying it?
Joined: 23 Oct 2011
Online Status: Offline
Posts: 4
Posted: 25 Oct 2011 at 12:14am
Thnx, I used the running totals and it works. But i also want tot use the overal total (receipe16665 total weight 0.5 kg, sub.9855 total 107.53Kg) of the recipe and subrecipe in an other formula. Is this possible?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 25 Oct 2011 at 3:29am
you cannot summarize a summary (e.g. Sum group level RT's) but you can create another Running Total that is the same as the group level summary except that the reset value is set to Never for a report total.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 25 Oct 2011 at 8:38am
not sure I understand your data well enougth to answer your question exactly but
when using a running total or a variable formula the final total value does not exist until all rows have been read and it stops 'existing' after it hits a 'reset'. So if you want to use the 'final amount' in another calculation, that calculation formula has to be placed in the location of the report that allows for its reference to the RT to have read all of the approriate rows (e.g. a footer).
Joined: 23 Oct 2011
Online Status: Offline
Posts: 4
Posted: 04 Nov 2011 at 5:04am
Thnx for your help but it didn't work like i hoped to. I hoped that de subrecepture and their weight didn't multiply when i add the ingredients but staid unique value.
When i use the formule DISTINCTCOUNT the database recongize that there are 2 unique (subrecept) values. But is there also a formula which display which these 2 unique values are?
For Example 2 unique (subrecept) values 9855 and 16594. the wieght of these unique values is 0.26 and 0.24 so sum is 0.500.
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