Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEED TO CREATE A GROUP TO TOTAL ON - BUT PROBLEM WITH DATA

Status
Not open for further replies.

mollie

IS-IT--Management
Jan 6, 2002
27
US
Hi -

I'm tearing my hair out with this one. I need to create a group but the data in the records isn't helping me much:

ex:

item line # price cost kit

a 1 10,000 yes
b 2 0 3000
c 3 0 20
d 4 5,000 300
e 5 8,000 300 yes
f 6 0 50

I want to be able to add the costs together for the kits.

so, in the example above, the rev and cost for item a-c should be combined into one group (kit) - - d is just an item by itself and e-f would be another "kit"

I do have a way of determining the first item that is part of the kit - - - but not the remaining items. If I can find a formula to help me do that I can group away and sum as I need.

example of what I want to do

item line # price cost kit

a 1 10,000 yes
b 2 0 3000
c 3 0 20
subtotal 10,000 3020

d 4 5,000 300

e 5 8,000 300 yes
f 6 0 50
subtotal 8,000 350

or - I don't mind subtotaling d either, and then just showing that "group" and make drilldowns availble - - - but the key is to be able to subtotal rev/cost - - - and I have nothing to tell me it's a child of a kit item (other than 0 rev and no cost) - - I tried while reading recrods., etc.,




Any help would be much appreciated!!!

thx

mollie
 
Hi,
What shows that b and c are part of a's kit?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
that's the problem! there is nothing in the datafile to indicate that.

However, the kit items USUALLY show up immediately after the kit master and USUALLY have 0 cost - - - - 99% of the time.
 
If there is nothing to link the records then you cannot group them.

You could get totals using variables, using the NEXT command to see if the next record is (probably) starting a new kit.

PS. Using block capitals counts as SHOUTING and is not polite.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
madawc -

meant no harm by the caps - - - meant to emphasize the word usually - - - - didnt' realize caps were on in the header of the qeustion.

point taken.

yes, I was wondering how to use the next command to figure it out - - - I haven't been successful thus far.

so, for example, if line a is a "kit' - which can be identified, and line b is a sell price of 0 - - I'd like it to be identified as a kit also ...

any idea?
 
Try several tests. Or question why the data is so ambiguous.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top