Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

data restriction to 3 years

Hi Everyone,

        

                  I am using Employee database,it contains 10 years of data(2006-2016) .

My Scenario - I need to extract only 3 years of data (2014-2016),and i have to consider active employees those whoever joined on 2006 as well.

I have written the below Script for restriction:

((EFFECTIVE_TO_DATE=today() or DATE_OF_JOIN>=MAKEDATE(2014,01,01)) or DATE_OF_RESIGNATION>=MAKEDATE(2014,01,01))


Please find the attached sample data.

Any suggestions would be greatly appreciated.

Thanks & Regards,

P.Divya

2 Replies
karthikoffi27se
Creator III
Creator III

Hi Divya,



May be you can try this way


Select *

From EmpTable

Where

DATE_OF_JOIN>=MAKEDATE(2014,01,01) and DATE_OF_RESIGNATION>=MAKEDATE(2014,01,01) 

or 

DATE_OF_JOIN>=MAKEDATE(2006,01,01) and DATE_OF_RESIGNATION>=Today()

;



Hope this helps.


Thanks

Karthik


varshavig12
Specialist
Specialist

What do you mean by active ?

1. They are still effective

2. They have not resigned.

Can you post your expected output based on the sample data which you provided ?