Page 1 of 1
Changing element name
Posted: Thu Sep 04, 2014 1:40 pm
by BariAbdul
This might be quite easy one TM1 gurus,I need to change an element name in the model,I know I need to create an alias and simply use the TI function: SwapAliasWithPrincipalName(DimName,AiasName,Flag) in prolog.
But my question is, this particular element has been refrenced widely in rules with other cubes.Is there any chance of something going amiss if I change the element name.Thanks
Re: Changing element name
Posted: Thu Sep 04, 2014 3:02 pm
by jim wood
I'm sur ethis is something that is easily done these in PM, but in earlier version it was a task. From what I know of PM it will simply run TI's in the background. For rules it will depend I guess on how they are defined, if they are link / dimension calculations setup in PM you're probably good. Any manual calculations added will probably be another question entriely,
Jim.
Re: Changing element name
Posted: Thu Sep 04, 2014 4:24 pm
by BariAbdul
Thanks for the reply Jim,unfortunately I am on 9.5.2 so PM is out of question , as I mentioned before there are quite a few rules written across the cubes on this element,is there any workaround to this,Please! Thanks
Re: Changing element name
Posted: Thu Sep 04, 2014 4:32 pm
by tomok
Your only option is to use a text editing tool against the .rux files for a search and replace. I'm partial to Notepad ++ but there are other tools that function just as well. 1) Go to the data folder and open all the .rux files, 2) search and replace, delete all the .blb files where all the characters on the left hand side of the dot (".") equal the cube name (these files are rules formatting files), 3) recycle the server.
Re: Changing element name
Posted: Thu Sep 04, 2014 4:43 pm
by BariAbdul
Thanks a lot Tomok,Appreciate your help.
Re: Changing element name
Posted: Thu Sep 04, 2014 5:55 pm
by gtonkin
You could also try using SED (command line tool)
You need to use notepad to create an input file for SED to process - call it rename.sed for example then enter in
I then use a batch file to execute through the various file types:
Code: Select all
@echo off
set currdir=%CD%
echo %currdir%
for /R %%D in (.) do (
echo %%D
cd %%D
for /F "tokens=*" %%F in ('dir *.rux /b') do ( echo %%F
sed -f %currdir%\rename.sed "%%F" >temp
move /Y temp "%%F" >nul
)
cd ..
)
I would recommend a solid back-up and double-and triple checking once run.
You may need to add multiple lines in rename.sed for mutiple search and replaces. Also keep in mind that the example is case sensitive - there may be parameters you can pass to search and replace without considering case.
You could/should also copy the FOR section multiple time, one for BLB, RUX and PROs
Read carefully and use at your own risk once you have understood the process - if incorrectly used, you could end up with a whole lot of zero sized files
Re: Changing element name
Posted: Fri Sep 05, 2014 10:25 am
by deepakjain2020
Tomok reply is nice

You can try with Advance Rules Editor for search and replace. Which will not require deletion of .blb files.
Regards,
Deepak Jain
Re: Changing element name
Posted: Fri Sep 05, 2014 12:16 pm
by tomok
deepakjain2020 wrote:You can try with Advance Rules Editor for search and replace. Which will not require deletion of .blb files.
Indeed you can but you have to do each rule file one by one. With Notepad ++ you can open all the files at once and do just one search and replace. Much more efficient.
Re: Changing element name
Posted: Fri Sep 05, 2014 1:02 pm
by deepakjain2020
Thanks Tomok. That's good one
