cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Windchill reports - omit weekends and holidays

MikeLockwood
22-Sapphire I

Windchill reports - omit weekends and holidays

I posted on this before asking if anyone knew how to omit weekends and holidays from days between windchill events / timestamps (like created until approved, etc.). Many who replied said "Let me know when you get it working." We've now got this working in Cognos Business Reporting, using query calculation.

Code that finds working days between now and 14 days ago (substitute actual timestamps):

_days_between(current_date, _add_days(current_date,-14) ) -
( (_days_between( _add_days( _add_days(current_date, -0) ,(-1) * (_day_of_week(current_date,7) ) +1),
_add_days( _add_days(current_date, -8) ,(-1) * (_day_of_week(_add_days(current_date,-8),7)) +1)
)
)+
(_days_between( _add_days( _add_days(current_date, -0) ,(-1) * (_day_of_week(_add_days(current_date,-0),7))),
_add_days( _add_days(current_date, -8) ,(-1) * (_day_of_week(_add_days(current_date,-8),7)))
)
)
)/7 - 1

Tech Support said (confidently) that this couldn't be done. I now have a new call in to tech support with this code on it, asking how to get holidays from the Windchill calendar. Hopefully someone has a suggestion on how to do this.

1 REPLY 1

Mike,

I did that once with MSACCESS, I used a table of working days, then a select count(workingDay.date) where workingDay.date > begindate and workingDay.date<enddate.< p=">

This can be easily done with the query builder (Iattached a proof of concept report that counts the number of workitems created between the creation of a PR and that date + 14). This can be modified to count say working days between PR Open and PR resolved.

What is needed is the creation of the workingday table. Maybe creating a dedicated soft type would do the trick. Creatingan objectper working day would require some jsp/java programming.

HTH,

Vincent


In Reply to Mike Lockwood:

I posted on this before asking if anyone knew how to omit weekends and holidays from days between windchill events / timestamps (like created until approved, etc.). Many who replied said "Let me know when you get it working." We've now got this working in Cognos Business Reporting, using query calculation.

Code that finds working days between now and 14 days ago (substitute actual timestamps):

_days_between(current_date, _add_days(current_date,-14) ) -
( (_days_between( _add_days( _add_days(current_date, -0) ,(-1) * (_day_of_week(current_date,7) ) +1),
_add_days( _add_days(current_date, -8) ,(-1) * (_day_of_week(_add_days(current_date,-8),7)) +1)
)
)+
(_days_between( _add_days( _add_days(current_date, -0) ,(-1) * (_day_of_week(_add_days(current_date,-0),7))),
_add_days( _add_days(current_date, -8) ,(-1) * (_day_of_week(_add_days(current_date,-8),7)))
)
)
)/7 - 1

Tech Support said (confidently) that this couldn't be done. I now have a new call in to tech support with this code on it, asking how to get holidays from the Windchill calendar. Hopefully someone has a suggestion on how to do this.

Top Tags