5 Replies Latest reply: Jan 9, 2013 4:34 AM by Stefan Wühl

# Logic Problem

Hii to all,

I am sharing a problem  and hope that someone will solve it.

I want the count of those employee who are active 'ac' in 2012 and whose promotion flage is 'F' for the last three consecutive year. i am also attaching an application file where i got the result, but there i am also getting f employee whose promotion flag is not 'F' for last three consecutive year.I want to exclude that employee against which promotion flag 'F' is maintained for last three years

• ###### Re: Logic Problem

Try maybe something like

=count(

{<

Emp = p({<Year={"\$(vmaxyear)"},Active={'ac'}>}Emp)

* {"=count({<Promotion = {f}, Year={'>=\$(vmaxyear_3)'}>}distinct Year)=3"}

>}

distinct Emp)

• ###### Re: Logic Problem
 Emp Name FinFlag Promotion Active 1 a 2008 f ac 1 a 2009 f ac 1 a 2010 f na 1 a 2011 f ac 1 a 2012 f ac 2 b 2008 f ac 2 b 2009 t ac 2 b 2010 t ac 2 b 2011 f ac 2 b 2012 f ac 3 c 2008 f ac 3 c 2009 t ac 3 c 2010 f ac 3 c 2011 f ac 3 c 2012 f ac 4 d 2008 f ac 4 d 2009 f ac 4 d 2010 f ac 4 d 2011 f ac 4 d 2012 f ac 5 e 2008 t na 5 e 2009 t na 5 e 2010 t ac 5 e 2011 f ac 5 e 2012 f ac 6 f 2008 ac 6 f 2009 ac 6 f 2010 f ac 6 f 2011 f ac 6 f 2012 f ac

Now my data look as above format.I want only those employee who are active in 2012 and Promotion is 'f' for last three year.

• ###### Re: Logic Problem

You just need to rename field FinFlag to Year and adapt your two variable definitions to the different Year format.

• ###### Re: Logic Problem

I don't understand what r u saying. It is my humble request to u to develop the test application based on my given data and requirement.

• ###### Re: Logic Problem

Data:

Name,

FinFlag as Year,

Promotion,

Active

FROM

[.\empTest2.xlsx]

(ooxml, embedded labels, table is Sheet2);

Variable definitions:

vmaxyear:          =max(Year)

vmaxyear_3:      =max(Year)-2