Schedule chore for a specific time

Post Reply
mbeckw
Posts: 29
Joined: Tue Jul 08, 2008 5:00 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2010

Schedule chore for a specific time

Post by mbeckw »

I would like to have a chore run only M-F from 8am to 6pm. I would imagine I put the syntax in the prolog tab of the TI process I am running in the chore. Can anyone help me with the syntax. I would be forever greatful.

Thanks,

Mark
TM1 version 9.1 using excel 2003
User avatar
jim wood
Site Admin
Posts: 3952
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Schedule chore for a specific time

Post by jim wood »

There is a more simple but messy option which is to create a schedule for each day?
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
mbeckw
Posts: 29
Joined: Tue Jul 08, 2008 5:00 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2010

Re: Schedule chore for a specific time

Post by mbeckw »

Thanks Jim. I did think about doing that but there is not an option to schedule the chore to only run it from 8am to 6pm. Do you know how to do that?

Thanks
TM1 version 9.1 using excel 2003
ajain86
Community Contributor
Posts: 132
Joined: Thu Oct 15, 2009 7:45 pm
OLAP Product: TM1
Version: 9.4.1 9.5 9.5.1
Excel Version: 2003 2007

Re: Schedule chore for a specific time

Post by ajain86 »

To limit to 8 am to 6 pm, you can do an if statement to check current time and only proceed if it is in between the desired time.

so:
assuming you are running the chore once an hour.

# to get the current hour
sTime = SUBST(TIME,1,2);

# convert to number to easily to comparison
nTime = StringToNumber(sTime,2,0);

# make sure to account for GMT and your time zone.
if (nTime > 8 & nTime < 18);

execute....

endif;

You would have to schedule it to run every hour. I am not aware of a function to get the day of the week.
Ankur Jain
mbeckw
Posts: 29
Joined: Tue Jul 08, 2008 5:00 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2010

Re: Schedule chore for a specific time

Post by mbeckw »

Thanks

I assume I would put this in the prolog tab of the TI process?
TM1 version 9.1 using excel 2003
ajain86
Community Contributor
Posts: 132
Joined: Thu Oct 15, 2009 7:45 pm
OLAP Product: TM1
Version: 9.4.1 9.5 9.5.1
Excel Version: 2003 2007

Re: Schedule chore for a specific time

Post by ajain86 »

Yes.
Ankur Jain
User avatar
LoadzaGrunt
Posts: 72
Joined: Tue May 26, 2009 2:23 am
Version: LoadzaVersions
Excel Version: LoadzaVersions

Re: Schedule chore for a specific time

Post by LoadzaGrunt »

I am not aware of a function to get the day of the week.
There isn't one - use a combination of DAYNO and MOD to find out the day of the week.
lotsaram
MVP
Posts: 3663
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Schedule chore for a specific time

Post by lotsaram »

LoadzaGrunt wrote:There isn't one - use a combination of DAYNO and MOD to find out the day of the week.
To handle the weekday lookup you can also have a "system days" lookup dimension which is just all dates in yyyy-mm-dd format and hold attributes against the dimension for situations such as this. Then to return the day of the week you just need something like AttrS('System Date', TODAY(1), 'Weekday').

As Peter K posted recently time based lookup attributes are really really easy to calculate in Excel and send in and this is a once off setup task that never needs to be repeated.
User avatar
Alan Kirk
Site Admin
Posts: 6610
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Schedule chore for a specific time

Post by Alan Kirk »

LoadzaGrunt wrote:
I am not aware of a function to get the day of the week.
There isn't one - use a combination of DAYNO and MOD to find out the day of the week.
Specifically:

Code: Select all

# Returns 0 = Sunday to 6 = Saturday.
l_DayOfWeek= Mod ( DayNo( TODAY ) + 21915, 7); 
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: Schedule chore for a specific time

Post by kangkc »

We took it to the extreme. We built a calendar schedule cube with calendar date/timing. Add in a common code in the prolog for all the processes to check this cube before executing. With this we can have full control when to execute certain processes.
Sandhya Kumar
Posts: 43
Joined: Thu Sep 10, 2009 6:36 am
OLAP Product: TM1
Version: 9.0 and above
Excel Version: 2003

Re: Schedule chore for a specific time

Post by Sandhya Kumar »

If you can use an external scheduling tool like Autosys, you can make use of this option- TM1ChoreExecute.exe. This will be present in the tm1\bin folder and we can create an Autosys job with the below command and specify schedule of our choice:

<<dir location>>\TM1ChoreExecute.exe AdminServer TM1Server UserID Password ChoreName
appleglaze28
Regular Participant
Posts: 269
Joined: Tue Apr 21, 2009 3:43 am
OLAP Product: Cognos TM1, Planning
Version: 9.1 SP3 9.4 MR1 FP1 9.5
Excel Version: 2003

Re: Schedule chore for a specific time

Post by appleglaze28 »

Code: Select all

# make sure to account for GMT and your time zone. 
if (nTime > 8 & nTime < 18);
I would like to clarify something with the setting of the time.
For example the time in my country is GMT+8 3:54PM but base on the chore the GMT time is 7:54AM.

I've been trying to work out the time but I can't seem to understand how to set the time to run from with 3-4PM. The only time set I was able to work on is 14:00 - 16:00. I was thinking I have to set the time as local time zone time less 1 but It doesn't work on 14:00 - 15:00. It wants 2 hours for allotment for it to run.

Code: Select all

# make sure to account for GMT and your time zone. 
if (nTime > 14 & nTime < 16);
Am I right or wrong about this?
User avatar
Alan Kirk
Site Admin
Posts: 6610
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Schedule chore for a specific time

Post by Alan Kirk »

appleglaze28 wrote:

Code: Select all

# make sure to account for GMT and your time zone. 
if (nTime > 8 & nTime < 18);
I would like to clarify something with the setting of the time.
For example the time in my country is GMT+8 3:54PM but base on the chore the GMT time is 7:54AM.

I've been trying to work out the time but I can't seem to understand how to set the time to run from with 3-4PM. The only time set I was able to work on is 14:00 - 16:00. I was thinking I have to set the time as local time zone time less 1 but It doesn't work on 14:00 - 15:00.
It helps if you indicate where you're deriving values like nTime from.

If you're getting it from TI's date and time functions, like so:

Code: Select all

nTime = TimVl( Now(), 'H') ;
then the time zone that you're in is immaterial. Although log files are recorded in UTC, although chores are irritatingly scheduled in UTC, the time and date functions work from the local time. Thus the code above for me (where it is 7:36pm as I type this, or 19:36 in military time), yields 19.
appleglaze28 wrote: It wants 2 hours for allotment for it to run.

Code: Select all

# make sure to account for GMT and your time zone. 
if (nTime > 14 & nTime < 16);
Am I right or wrong about this?
You might want to look at your code a little more closely. That's not a 2 hour allotment, that's only a 1 hour allotment. Remember that you're only testing the hour component (as far as I can tell), not the actual time. If it has to be greater than 14 but less than 16, then the hour can only be... 15. In other words it will run between 3:00:00pm and 3:59:59pm. It would probably be easier to express it as:

Code: Select all

if (nTime = 15);
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply