I need help with BAQ

Hi,

I’m having problem with creating a BAQ and getting back the results I want.

What I’m trying to do is create a dashboard that will show which employees worked on a serial number for each specific part.

everything works fine when I set up the labordtl with the JobNum, PartNum, ClockInDate, ClockInTime and ClockOutTime, but as soon as I add int he SNTran table the results are incorrect, it shows one entry that was for one part under multiple parts.

Has anyone done this before or can help me get the results I want?

Can you post a screenshot of the query?

Here’s a screen shot of the query.

Can you add the Trantype field from the serial Tran table and see if you are getting multiple transactions?

Might need to filter the Tran types.

Ive added the trantype and filtered it but now i am getting 0 results back…

Are those op codes or sn Tranaction types?

I’ve gone back and tried something different to see if it helped, I took out the JobOpr table and just inner joining LaborDtl and SNTran.

For testing purposes I’ve filtered the JobNum and EmployeeNum to see a transaction I put in yesterday.

SNTran is also filtered to show results for OPR-CMP or OPR-RWK

The display fields are as per below.

The results come back with multiple lines for one transaction, the actual transaction is for serial number 0906.

Query comes out as per below.

The actual transaction in the database shows only the 1.

They are TranTypes.

I’m not super familiar with the sntran table, but does that table have an op sequence number in it? You have the job opening table joined with the SN table , but there are going to me multiple ops and I think that’s why you are getting multiple rows.

If there is not an op sequence, I’m going to assume that the serial number is applied at the last operation. If you only want that operation, then you will need to make a subquery and do a calculated field with Max(opseq) and then group by job number and part number, the join to that sub query.

If you want everyone who worked on that part, then add the labor detail table in there but only show the employee ID and group by that. You can remove the op sequence unless you want to see that. That will give you a row for every serial number and person that worked on the serial number.

I hope that makes sense, I’m not at a computer right now .

Also what was the labor qty on that transaction? If he made more than one, he’s going to have more than one serial number.

1 Like

@Banderson, looking at the table now. I was wondering what is missing from the join and thinking the same as you. there are assembly levels and opseq to link the tables.

1 Like

The SNTran tablle doesn’t have OprSeq in it, it only has LastLbrOprSeq.
But I want to see all the OprSeq for each serial number

What was the quantity on that labor transaction?

Only 1

Is that same part number used multiple times in the job? Add the assembly sequence to the join on the serial table and the job opr table. (I’m looking at your first query if that helps). Also, you should remove that distinct from the subquery settings. If you are getting duplicate rows, you’ll want to know that and fix your joins.

What version is your database? OprSeq is in the SNTran table at 10.2.300 and I think it has been in for a while. On the Job Setup when is the serial number tracked? Is the serial number tracked at each operation that is completed, or only at the end of the job? There is a Serial Number checkbox on the operation configuration in the BOO. What @Banderson is suggesting in written format sounds like it should work? The other option is to reverse your anchor table (first table). Since you are wanting who worked on each serial number, not what employees worked on what you could start with SNTran. Query the table and group like has been suggested, by Serial Number, TranType, PartNum, JobNum, AssemblySeq, OprSeq. Then link this to JobOper by JobNum, AssemblySeq, OprSeq. Then to LaborDtl by JobNum, AssemblySeq, OprSeq. Suggest to include company as a link field as well, but not as important if you do not have more than one company in the database. Finally, you can possibly drop out the JobOper table since LaborDtl should have everything you need to link to SNTran.

Your result set from SNTran should have every serial number with each individual operation per job and assembly sequence which was collected for the given part number. Then, you just add in the employee or employees for that transaction if multiple resources worked on the operation.

This is definitely doable. I would pick one job and one part number. Query each table for all the records pertaining to that job and part separately. Which ever query got the most records with the grouping will be your expected recordset. It is possible to have multiple labordtl records if the part is worked on multiple days as well. If this is the case you will need to group and max some fields.

1 Like

Yes it’s the same PN, whe have around 24-40 operations for our parts.

Our version is 10.1 we havn’t upgraded to 10.2.

The serial number is tracked from the first operation.

Yes the serial number is tracked at each operation

I will try and revers the tables to see if that helps and link as per your guys suggestins will update once I have done

Before you change anything big, just add the assembly seq to the join. It shouldn’t matter which order you have the tables (for something like this). They match or they don’t. It would just be a mental exercise that may help you understand what is going on.

OK, So I’ve tried both suggestions, and as soon as I add oprseq, the result comes back with 0 results

Can you paste in your current query?