Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get Employees promoted consecutively for last 3 years

Hi All...

I need show Employees who got promoted consecutively for last 3 years.

For Eg. IF  Emp(E1) is promoted in 2011,2010 n 2009 then he should be in the list.

where as IF  Emp(E2) is promoted in 2010 ,2009,2008 but not in 2011 then he shouldnot be in the list.

I have Year wise Employee name followed by a Flag which indicate the promtoion.

I have attached a QVW for the same..

Please Help wid the logic.

Thanks.

8 Replies
v_iyyappan
Specialist
Specialist

Hi,

Please see the attached file. Hope its helpful for u.

Regards,

Iyyappan

Anonymous
Not applicable
Author

Thanks Iyyappan..

In your QVW if any perticular employee is been promoted in 2005, 2008 and in 2010 then also he will fall in the list..

But i want employees who got promoted consecutively for LAST 3 years only..

As my current year is 2012 so,emp promoted only in 2011,2010 n 2009 will give me the right ans...

Regards,

Snehal

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Do you mean like this?

     Sum({<PromotedYear={$(=Max(Year))}*{$(=Max(Year)-1)}*{$(=Max(Year)-2)}>} Salary)

Celambarasan

check now.Message was edited by: Celambarasan Adhimulam

Anonymous
Not applicable
Author

Hi Celambarasan,

Iam not able to get your expression.

According to me ' * ' in this exp is simply multiplication which will multilpy promotion years so it will never be equal to any of the PromotionYear.

And i need to list only employees who got promoted consecutively for LAST 3 years ..

SunilChauhan
Champion II
Champion II

in dimension em

Employee_Code

and in expressio use

count(distinct if((Promotion_Year>=Promotion_Year-3 ) and Promotion_Flag='TRUE',1))

hope this help

Sunil Chauhan
v_iyyappan
Specialist
Specialist

Hi,

Use expression like this,

=Count({$<Promotion_Year = {$(#vSelectedDate)},Promotion_Flag={'TRUE'}>}DISTINCT Employee_Code)

Where vSelectedDate = chr(39)&Max(Promotion_Year)&chr(39)&','& chr(39)&(Max(Promotion_Year)-1)&chr(39)&','&chr(39)&(Max(Promotion_Year)-2)&chr(39)('2011','2010','2009')

Regards,

Iyyappan

Anonymous
Not applicable
Author

Thanks Sunil..

This exp will onlu give me emp who are promoted irrespective of the year instead of consecutive  LAST 3 years ..

Anonymous
Not applicable
Author

Hi,

Count({$<Promotion_Year = {$(#vSelectedDate)},Promotion_Flag={'TRUE'}>}DISTINCT Employee_Code)

Where vSelectedDate = chr(39)&Max(Promotion_Year)&chr(39)&','& chr(39)&(Max(Promotion_Year)-1)&chr(39)&','&chr(39)&(Max(Promotion_Year)-2)&chr(39)('2011','2010','2009')

This exp will give me employees who are promoted either in 2009 OR in 2010 OR in 2011...

But i want Employees who got promotion in 2009 AND in 2010 AND in 2011