yolly12
MIS
- Mar 21, 2005
- 83
environment - GoldMine 6.7 GMCE - SQL 2000, Crystal Reports 9 pro.
I am writing a report that at first I thought I could do as a cross tab but none of the formulas would work so I ended up taking another approach. below is what the end result is suppose to be;
product: total fred barney goerge
Fabric - Misc
buttons 5 -10 0 15
zippers -8 10 -8 -10
Fabric
cotton-blue 5 0 5 0
you get the idea. Where the data is stored is hard to get to and they want the products to be listed in subcategories that are not tracked anywhere in the program and in a particular order. then when the sell something sells, they complete the activity with a SLD code and if the product sells then cancels, the same completed activity then gets the code changed to CAN. code btw.. is a field.
so this is what I did. I first created a formula for the categories that aren't tracked anywhere in the program.
if {conthist.ref} startswith "BUT" then totext ("Fabric - Misc") else
if {conthist.ref} startswith "ZIP then totext ("Fabric - Misc") else
if {conthist.ref} startswith "CBL" then totext ("Fabric") else unknown
the reason why startswith needs to be used is that GoldMine attaches everything to contacts so it inserts the contact's name after the actual thing entered in the field. I took this formula and made a group for it - categories taken care of.
then the {conthist.ref} needed to be translated into proper name so I created another formula:
if {conthist.ref} starts with "BUT" then totext ("Buttons") else - and so on. I took this formula and made another group.
instead of creating a seperate formula for each user and each product I came up with 4 (instead of 50 per user). Not only did I have to find the activities but I must sub total the SLD and sub total the CAN and display the end result for each product.
(to find the SLD and CAN)
if {conthist.userid} = 'BARNEY' and {conthist.code} ='SLD' then tonumber ({conthist.units}) else 0
you get the idea - wont type the one for CAN. then I made one for the TL
(sum({@BARNEYWON}, {@prods}) - (sum({@BARNEYLOS}, (@prods})
I placed thw WON/LOS in details and suprssed it and I placed the TL formula in the group header for the second groups which had the product translations. works great.
here is my problem - I need to do a subtotal (add up all users TL per product (second group) AND the category (take subtotals of the per product and give sum) and then come up with a master grand total.
I placed formulas in the group footer of the first group and it is not working (sum(@BARNEYWON)) - (sum(@BARNEYLOS)) and it gives a number for all users instead of what the WON/LOS formula says (specifically lists userid)
so where am I going wrong here?
thanks btw for helping
I am writing a report that at first I thought I could do as a cross tab but none of the formulas would work so I ended up taking another approach. below is what the end result is suppose to be;
product: total fred barney goerge
Fabric - Misc
buttons 5 -10 0 15
zippers -8 10 -8 -10
Fabric
cotton-blue 5 0 5 0
you get the idea. Where the data is stored is hard to get to and they want the products to be listed in subcategories that are not tracked anywhere in the program and in a particular order. then when the sell something sells, they complete the activity with a SLD code and if the product sells then cancels, the same completed activity then gets the code changed to CAN. code btw.. is a field.
so this is what I did. I first created a formula for the categories that aren't tracked anywhere in the program.
if {conthist.ref} startswith "BUT" then totext ("Fabric - Misc") else
if {conthist.ref} startswith "ZIP then totext ("Fabric - Misc") else
if {conthist.ref} startswith "CBL" then totext ("Fabric") else unknown
the reason why startswith needs to be used is that GoldMine attaches everything to contacts so it inserts the contact's name after the actual thing entered in the field. I took this formula and made a group for it - categories taken care of.
then the {conthist.ref} needed to be translated into proper name so I created another formula:
if {conthist.ref} starts with "BUT" then totext ("Buttons") else - and so on. I took this formula and made another group.
instead of creating a seperate formula for each user and each product I came up with 4 (instead of 50 per user). Not only did I have to find the activities but I must sub total the SLD and sub total the CAN and display the end result for each product.
(to find the SLD and CAN)
if {conthist.userid} = 'BARNEY' and {conthist.code} ='SLD' then tonumber ({conthist.units}) else 0
you get the idea - wont type the one for CAN. then I made one for the TL
(sum({@BARNEYWON}, {@prods}) - (sum({@BARNEYLOS}, (@prods})
I placed thw WON/LOS in details and suprssed it and I placed the TL formula in the group header for the second groups which had the product translations. works great.
here is my problem - I need to do a subtotal (add up all users TL per product (second group) AND the category (take subtotals of the per product and give sum) and then come up with a master grand total.
I placed formulas in the group footer of the first group and it is not working (sum(@BARNEYWON)) - (sum(@BARNEYLOS)) and it gives a number for all users instead of what the WON/LOS formula says (specifically lists userid)
so where am I going wrong here?
thanks btw for helping