Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213916

DAX: Retrieve Fields Based on Time and Employee

$
0
0

Hi,

 

I have two tables, a movements data and a raw data.

 

The movements data keeps track of which department the employee had been in a particular duration or to which supervisor he was reporting to in any given duration as well (the table might explain better, and it only show movement of one employee for simplicity):

 

 

id_employeeid_supid_departmentdate_effective_startdate_effective_end
24478532447854112/1/201612/4/2016
24478532447855112/5/201612/10/2016
24478532447855212/11/201612/16/2016
24478535000001212/17/201612/31/2050

 

The raw data on the other hand is basically just a record of let's just say sales for example on any given day per employee.

 

But what I wanted to do is to retrieve the corresponding supervisor ID and department based on the raw data's transaction date and employee ID (the example below has only one employee for simplicity)

 

I hope the question/intent is clear and that is suffice to help me get out from this problem.

 

date_transid_employeeflagid_supid_department
12/1/20162447853P  
12/2/20162447853P  
12/3/20162447853P  
12/4/20162447853OFF  
12/5/20162447853OFF  
12/6/20162447853P  
12/7/20162447853P  
12/8/20162447853P  
12/9/20162447853P  
12/10/20162447853P  
12/11/20162447853OFF  
12/12/20162447853OFF  
12/13/20162447853P  
12/14/20162447853P  
12/15/20162447853P  
12/16/20162447853P  
12/17/20162447853P  
12/18/20162447853OFF  
12/19/20162447853OFF  
12/20/20162447853P  
12/21/20162447853P  
12/22/20162447853P  
12/23/20162447853P  
12/24/20162447853P  
12/25/20162447853OFF  
12/26/20162447853OFF  
12/27/20162447853P  
12/28/20162447853P  
12/29/20162447853P  
12/30/20162447853P  
12/31/20162447853P  

Viewing all articles
Browse latest Browse all 213916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>