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.

