4 Replies Latest reply: Jun 15, 2016 1:16 AM by Rick Worthy

Employees who only take leave on Monday & Friday

Hi I am trying to find a way to create a chart that will show Data for employees who take sick leave exclusively on Mondays and Fridays.  (Eventually, I am looking to include each side of Holidays as well).  Originally, I was using the experession

=if(WeekDay(leave)=0 or WeekDay(leave)=4, sum({<[Leave Type]={'Sick Leave'}>}pay_hours), null())

However, this returns the results for people who have leave on those days but may have leave on the other days as well.

• Re: Employees who only take leave on Monday & Friday

May be something like:

sum( {\$<[Leave Type]={'Sick Leave'}, people= E({1<leave={"=Match(WeekDay(leave),1,2,3,5,6)"}>}people)>} pay_hours)

people field has to be modified (possibly to 'Employee') according to your case. If this doesn't give you what you need, try to share a sample qvw explaining the expected output there.

• Re: Employees who only take leave on Monday & Friday

Hi,

Try this as well.

=if(num(WeekDay(leave))=0 or

num(WeekDay(leave))=4, sum({<[Leave Type]={'Sick Leave'}>}pay_hours), null())

• Re: Employees who only take leave on Monday & Friday

sum( {\$<[Leave Type]={'Sick Leave'},[Leave day]={'Mon,Fri'}>}people)>} pay_hours)

• Re: Employees who only take leave on Monday & Friday

I actually solved this by using:

if(sum({1<[Leave Type]={'Sick Leave'},[Leave day]={"Monday","Friday"}>} pay_hours) - sum({1<[Leave Type]={'Sick Leave'}>} pay_hours)=0,sum({1<[Leave Type]={'Sick Leave'}>} pay_hours) , null())

This basically says if you subtract the Total Leave Hours from the Total Leave Hours for Mon\Friday are they the same?  If so, present just those employees.  (My dimension is the employee if it wasn't obvious in the description).

Thanks to everyone for giving it a crack!