Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Contributor III

Re: data restriction to 3 years

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
Valued Contributor

Re: data restriction to 3 years

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 ?

Community Browser