Page 1 of 1

TI Process: how to justify if today() is 2nd work day of this month?

Posted: Thu Apr 07, 2016 12:26 pm
by Learn_TM1
Hi all,

Could some one help me how to create a TI process to justify if today is 2nd work day of this month? I know Today() return the current date. And Mod ( DayNo( Today ) + 21915, 7) will give the work day of this week. How to combine such functions to get the 2nd work day of the month?

Thanks a lot.

Learn_TM1

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Thu Apr 07, 2016 1:09 pm
by Wim Gielis
About 2 hours ago I posted a new article on my personal website on TM1 :o I can recommend it to you given this topic.

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Thu Apr 07, 2016 11:04 pm
by art83
Was going to suggest a cube and post some rules I wrote up awhile back before I saw Wim's response. Your lucky day to get a new Wim blog topic that answers your very question :D . Hard to find better TM1 instruction.

(FYI, Wim, your latest topic "Parameters in the tm1p.ini file" seems to have a broken link)

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Fri Apr 08, 2016 6:07 am
by Wim Gielis
Hello art,

You can still do so, the community can benefit from your good work. Thank you for telling me about the broken link, I will change it asap.

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Fri Apr 08, 2016 7:09 am
by Wim Gielis
The broken link has been replaced with a valid link. Thanks.

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Tue Apr 12, 2016 6:19 am
by macsir
Don't have to be rule. A simple process can do this as well.
Use a loop to check the day of the week from 1st of that month till today. If the day is weekend, skip the counter. When the counter is 2, then compare that date with today to see if they are equal.

Re: TI Process: how to justify if today() is 2nd work day of this month?

Posted: Tue Apr 12, 2016 11:46 am
by Wim Gielis
That's correct macsir. I had provided a solution using rules since a loop in TI is probably more easy to set up.