elsenorjose
Technical User
Hello again everyone. Seems like lately I've been stuck with some real toughies, at least tough for me anyway ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I am trying to calculate a metric involving repair rates for defective units for a certification report. Basically, the metric is defined thus:
Basically, the first part of the logic is just looking for anything that came back while still under warranty and I believe I've figured out that part:
The second part, the one I'm having difficulty with, is saying if a part has been returned more than once (the serial number will exist more than once in the RMA_Detail table), we want to see if it was most recently returned within 6 months of having been repaired and shipped back to the customer, regardless of warranty status. So if the item has a latest ship date of 06/01/2011 and a latest received date of say, 08/01/2011, we'd want to count it because it was returned to us within 6 months of the last time we shipped it to the customer.
I guess I also need to be careful not to double count anything that is still under warranty that has been returned to us more than once, but I think my first piece of logic handles that.
I'm using CR XI R2 on a SQL Server 2005 backend.
Thank you.
I am trying to calculate a metric involving repair rates for defective units for a certification report. Basically, the metric is defined thus:
If the unit is under warranty and it was returned (as tracked by a received_date field in a table) before end of the warranty period (as tracked by the expiration_date of the warranty in a table), then count it.
If the unit was returned (again, tracked by received_date) more than once and the latest received_date is within 6 months of the date the unit was sent back to the customer (based on a ship_date), count it.
Basically, the first part of the logic is just looking for anything that came back while still under warranty and I believe I've figured out that part:
Code:
If Not IsNull({RMA_Detail.SERIAL_52})
and ({RMA_Detail.RECDTE_52} <= {Ship_History.LABDTE_51} or {RMA_Detail.RECDTE_52} <= {Ship_History.MATDTE_51}) Then 1 Else 0
The second part, the one I'm having difficulty with, is saying if a part has been returned more than once (the serial number will exist more than once in the RMA_Detail table), we want to see if it was most recently returned within 6 months of having been repaired and shipped back to the customer, regardless of warranty status. So if the item has a latest ship date of 06/01/2011 and a latest received date of say, 08/01/2011, we'd want to count it because it was returned to us within 6 months of the last time we shipped it to the customer.
I guess I also need to be careful not to double count anything that is still under warranty that has been returned to us more than once, but I think my first piece of logic handles that.
I'm using CR XI R2 on a SQL Server 2005 backend.
Thank you.