Skip to content
Advertisement

How to find employee department changes?

I have a table that has the old departments and new departments of various employees:

EmployeeID OldDept NewDept
123 Design Design
234 Software Engineering
345 Design Software
456 Advertising Software

How can I create a table that looks like this:

Dept TransfersIn TransfersOut
Software 2 1
Design 0 1
Advertising 0 1
Engineering 1 0

Advertisement

Answer

Use below

if applied to sample data in your question – output is

enter image description here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement