Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post Reply
michaelc99
Posts: 46
Joined: Mon Jul 26, 2021 12:55 pm
OLAP Product: TM1
Version: 2.0.0
Excel Version: Office 365

Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post by michaelc99 »

Good Afternoon Everyone,

I have an existing cube with a number of views, TI processes, etc., along with the rules file and security settings. I was tasked with adding a dimension to the cube, but in my research it pointed to using a "IBM TM1/CX Planner Applications" Performance Modeler solution, that I am unable to access.

I know that changing a changing a cube name is fairly straight forward - simply stopping the server, changing the cube name in the data folder (along with the rules file, feeder, etc.,) and then restarting the server. However, my concern is that this solution is prone to error. So, the alternative route that I took was creating a new cube, adding all of the dimensions, copying the data from Cuba A to Cube B. My next steps are to re-build all of the views, security, TI processes, etc.

Is the approach that I took the 'best practices" approach, or is there a more straight-forward solution? Once I build Cube B, I will be tasked with renaming "Cube A" to "Cube A Historical" and "Cube B" to "Cube A". If I'm taking the right-approach, then I'll proceed forward; otherwise, I'll re-evaluate my steps.

Thank you in advance,
Michael
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post by vovanenok »

I would also go with creating a new cube and copying the data, so you can debug\test many things in parallel.
The next steps would depend on your model. Do you have rules referencing the cube you renamed? Do you have processes referencing that cube? What security you have for that cube and how it is implemented? Probably "search and replace" can do the most of the renaming (you can use Notepad++ to search and replace in TM1DATA directory) inside your model. What about other applications and APIs using your TM1 model/cube?

Let me share my personal approach. I always create a separate process to manage each cube and dimension. My process list looks like this:
arch.png
arch.png (171.26 KiB) Viewed 995 times
So for instance, cube - Cube1 process is used to create/update/recreate Cube1 cube, cube measure dimension, cube views, cube rule and cube security rule.

BTW, using my naming convention, I get the cube name from the process name:

Code: Select all

cub = Trim(Delet( pProcess, 1, Scan( '-', pProcess ) + 1 ));
Instead of hardcoding the cube names inside other processes, I use session variables

Code: Select all

StringSessionVariable( 'cubActual' );
StringSessionVariable( 'cubOsRpt' );
StringSessionVariable( 'dimCc' );
StringSessionVariable( 'dimCal' );
...
CellGetN( cubActual, elmCc, elmCal, ... );
The overall security is managed by the admin - security process, which can create security groups and set up object security.

Several advantages of this approach:
  • if I ever need to change something for Cube1 (like create a new view or measure dimension element), I simply make such change in the cube - Cube1 process
  • the same is for dimensions, I have hier - Dim1 process to create/update/recreate dimension/hierarchy/elements, setup/localize attributes, create/update subsets, etc.
  • if I need to deploy my changes from DEV to QA, I simply deploy the cube - Cube1 process and execute it in QA
  • to make sure the security is up to date, I simply execute the admin - security process
  • using release - * processes, I can bundle multiple changes and deploy all of them to a different environment
  • naming/development convention makes the life so easier, especially when there are >1 TM1 developer
I use my own TM1 Framework, similarly to Bedrock, it can automate many things (create dimensions/cubes/views/subsets, import/export/copy data, admin object security, etc.)

But now I'm switching more and more to "no code TM1 model development" using TeamOne Google Sheets add-on for IBM Planning Analytics (please look here https://www.tm1forum.com/viewtopic.php?t=16200, google it or contact me if you would like to know more).
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
michaelc99
Posts: 46
Joined: Mon Jul 26, 2021 12:55 pm
OLAP Product: TM1
Version: 2.0.0
Excel Version: Office 365

Re: Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post by michaelc99 »

Good Afternoon Vovanenok,

Thank you for the quick response!

It sounds like the path that I took, while painful, is the correct path. I'll run into additional headaches when renaming "Cube A" to "Cube A Historical" and "Cube B" to "Cube A". Though, I wonder if I should elect to copy PROD to DEV, then delete all references to "Cube A" in DEV before creating a new "Cube A" with the additional dimension added.

I took over the environment from a former employee who primarily coded rules with explicit cube names. So, rather than defining a variable name at top, and carrying that variable through-out the model, I am instead combing through lines of code. Which, a simple find/replace within Notepad++ could solve that problem. I have at least 10-15 processes and over 20 views to re-create so those will take a bit of time to re-do. As far as security, the cube is set to read-only based on specific client groups.

There are a lot of clean-up opportunities within process names at my company. The standard has been to use "CUBE NAME - PROCESS DESC" and either "Z_" or "ZZZ_" to define Admin Tasks. I was informed the "Z-method" was used to drop Admin tasks to the bottom of the list.

I will look into the TeamOne solution soon.

Thank you!
Michael
User avatar
gtonkin
MVP
Posts: 1192
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post by gtonkin »

If you are going to be renaming processes, you may want to consider naming your processes with } prefix to denote system objects.
Normal users will not see them unless the explicitly show these and have applicable security.
If you are using PAW, there is an option to create system objects now too.
michaelc99
Posts: 46
Joined: Mon Jul 26, 2021 12:55 pm
OLAP Product: TM1
Version: 2.0.0
Excel Version: Office 365

Re: Adding a DIM to an Existing Cube v Creating a New Cube and Renaming Cubes

Post by michaelc99 »

gtonkin wrote: Sat Sep 17, 2022 10:26 am If you are going to be renaming processes, you may want to consider naming your processes with } prefix to denote system objects.
Normal users will not see them unless the explicitly show these and have applicable security.
If you are using PAW, there is an option to create system objects now too.
Gtonkin, thank you for the tip. I will definitely be converting all Admin processes with the } prefix. Does that also work with Admin views as well?

Thank you,
Michael
Post Reply