Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
sravankv
Partner - Contributor III
Partner - Contributor III

Data Mapping Issue

Hi All,

Can some help me with below scenario..

Note: I have asked similar logic few days back. But this is bit different than this.

I have 2 tables 

1. Employ table with employ no, country and date(date when he was present in that country).

Emp_NoEmp_Start_DateCountry
10017/5/2007UK
10031/7/2007UK
10011/6/2008US
10014/1/2010AUS
1009/7/2011AUS

 

  2. Insider table with employ no, incident number(issues he worked on) and incident_created_date(when that issue was raised).

Emp_NoIncident NumIncident_Created_date
1001017/5/2007
1002017/5/2007
1003031/7/2007
100407/5/2008
1002311/6/2008
1003211/8/2008
1001112/1/2009
100214/2/2009
1003114/1/2010
1002418/6/2010
100539/7/2010
1006510/3/2011
100739/7/2010

 

Now I want to join both the tables and get Country field in Insider table. 

Based on Incident_Created_date <= Emp_Start_Date and where ever the dates are missing for that period the country should be previous country

i.e.  from above employ table we don't have any details from 12th Jun' 2008 to 13th Jan' 2010. 

10011/6/2008US
10014/1/2010AUS

 

But we will have data for this period in Insider table and for those records I want country to be US.

Like same for 1st Aug'2007 to 10th Jun'2008 Country = UK

10031/7/2007UK
10011/6/2008US

 

Expected Output:

Emp_NoIncident NumIncident_Created_dateCountry
1001017/5/2007UK
1002017/5/2007UK
1003031/7/2007Uk
100407/5/2008UK
1002311/6/2008US
1003211/8/2008US
1001112/1/2009US
100214/2/2009US
1003114/1/2010AUS
1002418/6/2010AUS
100539/7/2010AUS
1006510/3/2011AUS
100739/7/2010AUS

 

Thanks in Advance..

Labels (2)
2 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @sravankv ,

Is there any possibility to get Emp_End_Date in the first table. 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
sravankv
Partner - Contributor III
Partner - Contributor III
Author

@abhijitnalekar  thanks for replay.. Below is the solution, I got for my previous similar kind issue.

But the only additional condition is when ever there is 

where ever the dates are missing for that period the country should be previous country

i.e.  from above employ table we don't have any details from 12th Jun' 2008 to 13th Jan' 2010. 

10011/6/2008US
10014/1/2010AUS

 

But we will have data for this period in Insider table and for those records I want country to be US.

Like same for 1st Aug'2007 to 10th Jun'2008 Country = UK

10031/7/2007UK
10011/6/2008US

 

along with Incident_Created_date <= Emp_Start_Date

https://community.qlik.com/t5/QlikView-App-Dev/Data-Mapping-Issue/m-p/1838871