Reid Posted October 1, 2012 Posted October 1, 2012 Hello, I'm trying to sum a field "lu_lot_qty" but removing duplicate "ITW" numbers. So in the list there are 2 occurrences of ITW 1369 and 1439. I don't want the sum to include duplicates of these. The sum needs to be by "lu_lot_no". For lot 00000000, the correct sum should be 7,215 (not 13,119).
comment Posted October 1, 2012 Posted October 1, 2012 It looks like there should be another table where ITW and lu_lot_qty would be unique?
Reid Posted October 1, 2012 Author Posted October 1, 2012 Yes there is another table where ITW is unique. The qty is not, however.
comment Posted October 1, 2012 Posted October 1, 2012 In your example, whenever ITW repeats, so does lu_lot_qty. This would suggest that lu_lot_qty too belongs in the other table. I am only guessing here, because it's all Chinese to me. However, I am pretty sure the request is the result of data not being normalized properly.
Reid Posted October 1, 2012 Author Posted October 1, 2012 You are correct. The tables are linked by ITW. The part_no, lot_no, and lot_qty are lookups from the other table. I am using this table because I need a report by defects so I am using the most specific table possible while copying less specific data from other tables.
comment Posted October 1, 2012 Posted October 1, 2012 One way to get the correct result would be to divide the looked up (or the related) quantity by the count of the records in the category (ITW, I think). Then, when you summarize the calc, it will even out.
Recommended Posts
This topic is 4493 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now