convert string to code TM1

Post Reply
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

convert string to code TM1

Post by mrdauduong »

Hi community,

Iam looking for an idea. :!:

I have a client who have 53 cubes that use the dimension Version

I have to dev something that copie a version to another version for all the cubes.

Right now, the only solution i have is make 53 processus copy for each cube and 1 process MASTER to execute this 53 processus copy.

Another idea that i can thing about is make something "auto code" but i dont know how to make a string variable become the code TM1

For exemple

CubeName ='XXX';
CodeTM1= 'cellput('&CubeName&'.....&')'; ==> but how to make CodeTM1 work?

Is there another solution that can solve my case? :mrgreen:

Thanks a lot !
David Usherwood
Site Admin
Posts: 1453
Joined: Wed May 28, 2008 9:09 am

Re: convert string to code TM1

Post by David Usherwood »

That's the easy bit - because the cube name is just a string:

Code: Select all

CubeName ='XXX';
cellputn(cubename, v1,v2....vnn);
However I think you are hoping to build a complete cellputn statement. That's not possible in pure TI code. You could do it in TM1PY using tm1.processes.update_or_create though.
User avatar
Alan Kirk
Site Admin
Posts: 6606
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: convert string to code TM1

Post by Alan Kirk »

Another way might be to use the Bedrock library, where most of the code has been built for you. Specifically, the }bedrock.cube.data.copy process.
"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.
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

Re: convert string to code TM1

Post by mrdauduong »

Alan Kirk wrote: Sun Nov 20, 2022 4:09 am Another way might be to use the Bedrock library, where most of the code has been built for you. Specifically, the }bedrock.cube.data.copy process.
thanks, it is the thing i need for now !!!
David Usherwood wrote: Sat Nov 19, 2022 2:16 pm That's the easy bit - because the cube name is just a string:

Code: Select all

CubeName ='XXX';
cellputn(cubename, v1,v2....vnn);
However I think you are hoping to build a complete cellputn statement. That's not possible in pure TI code. You could do it in TM1PY using tm1.processes.update_or_create though.
thanks, i will try it in the future
Post Reply