fileexists and dimensionexists

Post Reply
raman
Posts: 10
Joined: Mon Sep 18, 2017 9:12 am
OLAP Product: tm1
Version: 10.2.2
Excel Version: 2010

fileexists and dimensionexists

Post by raman »

i am new to tm1. i want to make a ti process which first check wether the file exists or not, if fileexists then process should continue otherwise it should exit with a suitable message.then it should check for dimension and create or update according to availability of dimension.
Edward Stuart
Community Contributor
Posts: 247
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: fileexists and dimensionexists

Post by Edward Stuart »

What have you tried so far?

Have you seen the request for assistance guidelines

Have you tried googling for any information?

https://www.google.co.uk/search?q=cogno ... e&ie=UTF-8
raman
Posts: 10
Joined: Mon Sep 18, 2017 9:12 am
OLAP Product: tm1
Version: 10.2.2
Excel Version: 2010

Re: fileexists and dimensionexists

Post by raman »

i tried this
if(FileExists('filename')=1);
ExecuteProcess('dim_name');
else;
ProcessQuit;
endif;
but this one is sending the process into loop


and for dimension part i did

if(dimesnionexists('dim_name')=0);
dimensioncreate('dim_name');
else;
dimensionupdatedirect('dim_name');
endif;
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: fileexists and dimensionexists

Post by BariAbdul »

Have you defined the path correctly in the TI :

FileExists('C:\tm1s7\pdata\model.dim');

And created a wapper process to perform the evaluation in the PROLOG:

IF(FileExists('FILENAME') =1);
ExecuteProcess('Load Process Name Here');
ELSE;
ProcessQuit;
ENDIF;

As for the second part:
This feature can be used extensively after direct dimensioning with DimensionElementInsertDirect, DimensionElementDeleteDirect, DimensionElementComponentAddDirect, DimensionElementComponentDeleteDirect and / or DimensionTopElementInsertDirect. Calling the DimensionUpdateDirect function causes the entire memory to start consuming, but can be used to ensure that the dimension is the smallest possible impression of the memory when the processing is completed.
Thanks
"You Never Fail Until You Stop Trying......"
raman
Posts: 10
Joined: Mon Sep 18, 2017 9:12 am
OLAP Product: tm1
Version: 10.2.2
Excel Version: 2010

Re: fileexists and dimensionexists

Post by raman »

BariAbdul wrote: Wed Sep 20, 2017 11:30 am Have you defined the path correctly in the TI :

FileExists('C:\tm1s7\pdata\model.dim');

And created a wapper process to perform the evaluation in the PROLOG:

IF(FileExists('FILENAME') =1);
ExecuteProcess('Load Process Name Here');
ELSE;
ProcessQuit;
ENDIF;

As for the second part:
This feature can be used extensively after direct dimensioning with DimensionElementInsertDirect, DimensionElementDeleteDirect, DimensionElementComponentAddDirect, DimensionElementComponentDeleteDirect and / or DimensionTopElementInsertDirect. Calling the DimensionUpdateDirect function causes the entire memory to start consuming, but can be used to ensure that the dimension is the smallest possible impression of the memory when the processing is completed.
Thanks
so i have to create two processes for fileexists to work ,please tell if there is some way i can do in single process
and can i use a if within a if in ti
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: fileexists and dimensionexists

Post by tomok »

raman wrote: Wed Sep 20, 2017 10:20 am i tried this
if(FileExists('filename')=1);
ExecuteProcess('dim_name');
else;
ProcessQuit;
endif;
but this one is sending the process into loop
No, it isn't sending your process into a loop as you do not have any looping code, i.e., no WHILE statement. What you cannot do is use this logic in the Data tab, it must be in the Prolog. Yes, it is technically possible to do a FileExists in the Data tab but not with the logic you are using.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
raman
Posts: 10
Joined: Mon Sep 18, 2017 9:12 am
OLAP Product: tm1
Version: 10.2.2
Excel Version: 2010

Re: fileexists and dimensionexists

Post by raman »

can you suggest if file is missing i have to exit the process with a message, how to do that
Wim Gielis
MVP
Posts: 3103
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: fileexists and dimensionexists

Post by Wim Gielis »

One option is:

Above the ProcessQuit, add a line with the LogOutput function. Then you get the message you want in the message log. If you want to have the messsage in a different way, please give more context.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: fileexists and dimensionexists

Post by BariAbdul »

You could get further info regarding LogOutput here:
https://everanalytics.wordpress.com/201 ... ognos-tm1/ Thanks
"You Never Fail Until You Stop Trying......"
Post Reply