Schedule chore for a specific time
-
- 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
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
Thanks,
Mark
TM1 version 9.1 using excel 2003
- 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
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
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
-
- 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
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
Thanks
TM1 version 9.1 using excel 2003
-
- 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
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.
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
-
- 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
Thanks
I assume I would put this in the prolog tab of the TI process?
I assume I would put this in the prolog tab of the TI process?
TM1 version 9.1 using excel 2003
- LoadzaGrunt
- Posts: 72
- Joined: Tue May 26, 2009 2:23 am
- Version: LoadzaVersions
- Excel Version: LoadzaVersions
Re: Schedule chore for a specific time
There isn't one - use a combination of DAYNO and MOD to find out the day of the week.I am not aware of a function to get the day of the week.
-
- 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
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').LoadzaGrunt wrote:There isn't one - use a combination of DAYNO and MOD to find out the day of the week.
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.
- 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
Specifically:LoadzaGrunt wrote:There isn't one - use a combination of DAYNO and MOD to find out the day of the week.I am not aware of a function to get the day of the week.
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.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- 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
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.
-
- 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
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
<<dir location>>\TM1ChoreExecute.exe AdminServer TM1Server UserID Password ChoreName
-
- 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
Code: Select all
# make sure to account for GMT and your time zone.
if (nTime > 8 & nTime < 18);
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);
- 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
It helps if you indicate where you're deriving values like nTime from.appleglaze28 wrote:I would like to clarify something with the setting of the time.Code: Select all
# make sure to account for GMT and your time zone. if (nTime > 8 & nTime < 18);
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.
If you're getting it from TI's date and time functions, like so:
Code: Select all
nTime = TimVl( Now(), 'H') ;
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:appleglaze28 wrote: It wants 2 hours for allotment for it to run.
Am I right or wrong about this?Code: Select all
# make sure to account for GMT and your time zone. if (nTime > 14 & nTime < 16);
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.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.