# If/Then in BAQ Calculated Field

Doh. I guess that's the difference in E10 and E9. "CASE."

CASE JobAsmbl.Plant

WHEN 'LUBBOCK' THEN '5580'
WHEN 'CARLISLE' THEN '5520'

END

Okay, I'm a newbie and I need to learn a lot more, but right now I just need this one thing.

In a calculated field "EmployeeID" on a BAQ I need to look at the plant and set an employee number for transaction entry. Something like:

if  JobAsmbl.Plant = "LUBBOCK" then EmployeeID = "5580"

if  JobAsmbl.Plant = "CARLISLE" then EmployeeID = "5520"

Here's the phrase:

select

[JobAsmbl].[Company] as [JobAsmbl_Company],

[JobAsmbl].[Plant] as [JobAsmbl_Plant],

[JobAsmbl].[JobNum] as [JobAsmbl_JobNum],

[JobAsmbl].[AssemblySeq] as [JobAsmbl_AssemblySeq],

[JobOper].[OprSeq] as [JobOper_OprSeq],

[JobAsmbl].[QtyPer] as [JobAsmbl_QtyPer]

from Erp.JobAsmbl as JobAsmbl

inner join Erp.JobOper as JobOper on

JobAsmbl.Company = JobOper.Company

And

JobAsmbl.JobNum = JobOper.JobNum

And

JobAsmbl.AssemblySeq = JobOper.AssemblySeq

and ( JobOper.LaborEntryMethod = 'Q'  )

where (JobAsmbl.JobNum = '100107-1-1')

I would appreciate any feedback.

Thanks,

Joe

p.s. The "just one thing" is a big fat lie.

Hi Joe,

>>and set an employee number for transaction entry
>>
if  JobAsmbl.Plant = xxx then EmployeeID = yyy
Not sure what is meant by "transaction entry"?
Can you expand?
A basic BAQ with a calculated field or is this more involved, part of a customization?

We are entering transactions on jobs via DMT. I'm generating the file with this BAQ, and trying to avoid having to modify them in Excel to add info like the employee number.

Thanks,

Joe
It's E10, by the way.

Joe