View: dbo.Employee_Primary_Work_Location_Payroll_Department_View
View definition
`--Creating a view for Primary Location and Primary Department options in Employee Filter CREATE VIEW dbo.Employee_Primary_Work_Location_Payroll_Department_View AS SELECT employee_primary_work_location_payroll_department_KEY = W.employee_work_location_payroll_department_KEY ,W.work_location_KEY ,W.payroll_department_KEY ,W.employee_KEY ,W.pay_distribution_percent ,W.employee_work_location_payroll_department_guid ,department__active_status_KEY = CASE WHEN D.is_active = 1 THEN 1 WHEN D.is_active = 0 THEN 2 ELSE NULL END from dbo.Employee_Work_Location_Payroll_Department W left outer join dbo.Payroll_Department D on W.payroll_department_KEY = D.payroll_department_KEY Where W.is_primary = 1`