How do I write a TI code in Prolog tab for my requirement?

Post Reply
msrao186
Posts: 4
Joined: Mon Jan 09, 2017 9:26 am
OLAP Product: Cognos
Version: 10.2.2
Excel Version: 10

How do I write a TI code in Prolog tab for my requirement?

Post by msrao186 »

OLAP Product: TM1
Version: 10.2.2 64 bit
Excel Version: 2010
Area Facing issue: Prolog tab

Hello Everyone,

I have a requirement to build the dimensions and measures using the TI process in the Prolog section for one of my internal client. I know how to build/create these dimensions and measures manually in TM1 Architect and then load the data from the data sources, but my client does not want to go with this regular approach. My client wants everything to be done from the TI process like building the dimensions, measures and cubes then load the data into the cube by writing the code in Prolog selection.

I am very new to this Prolog coding and I am getting stuck and confused at this point and hence sincerely request for help on this.

Here are my dimensions and measures as follows below
Company Number,
Division Number,
Customer Name,
Job Type Description,
Month,
Year,
Lots,
Job City,
Contract Amount,
Revenue,
Budget Cost of Sales,
Actual Cost of Sales

Here months are divided into four Quarters (Q1, Q2, Q3, Q4) and here the Quarter roll-up is required. For example Q1 acts as Parent element and Jan, Feb and Mar are the child elements for Q1.

How do I build the code could anyone help me on writing the code for the above requirement? Please need help on this.

Thanks in advance..!
Rao
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: How do I write a TI code in Prolog tab for my requirement?

Post by TrevorGoss »

Hello Rao,

You will be lucky if someone on here writes your code for you, but below are some links to the functions that can help you do what you want to do.

http://www.ibm.com/support/knowledgecen ... ons_N71607 ... This link will take you to the TI functions that pertain to dimension manipulation.

http://www.ibm.com/support/knowledgecen ... ons_N7121E ... This one for cubes.

There are some functions for dimension editing that have "Direct" on the end. This means that the change will be made straight away, without the Direct in the name the changes you make to any dimension will not come into effect until the Prolog tab has finished. It is important to take into account that apart from the Direct functions, changes you make will not be saved to disk until the Prolog tab has finished.

Trev
tomok
MVP
Posts: 2832
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: How do I write a TI code in Prolog tab for my requirement?

Post by tomok »

msrao186 wrote:My client wants everything to be done from the TI process like building the dimensions, measures and cubes then load the data into the cube by writing the code in Prolog selection.
By definition (think of what the word "Prologue" means) the Prolog tab would be code that get's executed BEFORE you have access to the records in the data source of the TI process. How are you going to add all the Companies, Divisions, Customers, etc., if you don't know what they are? What you do is create the dimensions and cubes in the Prolog tab, add the elements in the Metadata tab, and load the data in the Data tab. This is pretty basic TI stuff and is covered very adequately in the user manuals.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
msrao186
Posts: 4
Joined: Mon Jan 09, 2017 9:26 am
OLAP Product: Cognos
Version: 10.2.2
Excel Version: 10

Re: How do I write a TI code in Prolog tab for my requirement?

Post by msrao186 »

TrevorGoss wrote:Hello Rao,

You will be lucky if someone on here writes your code for you, but below are some links to the functions that can help you do what you want to do.

http://www.ibm.com/support/knowledgecen ... ons_N71607 ... This link will take you to the TI functions that pertain to dimension manipulation.

http://www.ibm.com/support/knowledgecen ... ons_N7121E ... This one for cubes.

There are some functions for dimension editing that have "Direct" on the end. This means that the change will be made straight away, without the Direct in the name the changes you make to any dimension will not come into effect until the Prolog tab has finished. It is important to take into account that apart from the Direct functions, changes you make will not be saved to disk until the Prolog tab has finished.

Trev
Thank you very much Trevor. The links which you have sent are very useful to me I am working on this now.
msrao186
Posts: 4
Joined: Mon Jan 09, 2017 9:26 am
OLAP Product: Cognos
Version: 10.2.2
Excel Version: 10

Re: How do I write a TI code in Prolog tab for my requirement?

Post by msrao186 »

tomok wrote:
msrao186 wrote:My client wants everything to be done from the TI process like building the dimensions, measures and cubes then load the data into the cube by writing the code in Prolog selection.
By definition (think of what the word "Prologue" means) the Prolog tab would be code that get's executed BEFORE you have access to the records in the data source of the TI process. How are you going to add all the Companies, Divisions, Customers, etc., if you don't know what they are? What you do is create the dimensions and cubes in the Prolog tab, add the elements in the Metadata tab, and load the data in the Data tab. This is pretty basic TI stuff and is covered very adequately in the user manuals.

Thank you Tom.! I will do the same. I appreciate your time for quickly responding.
Mark RMBC
Community Contributor
Posts: 292
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: How do I write a TI code in Prolog tab for my requirement?

Post by Mark RMBC »

I don’t know about anyone else but for example, I have a model with 30 dimensions and I think I am safe to say that no 2 dimensions are built in the same way!

Some just add an element to the top consolidated level, others delete all the consolidated levels on the prolog and then rebuild the hierarchy again on the metadata, others create subsets as part of the build and some create the attributes. On one I use the Prolog to build the hierarchy by doing a while loop over the dimension, but that is another story. So I would say you need to think very carefully about how to future proof your dimension builds.

Also, in my opinion if you have a static dimension that will never change and only has a few elements within it then there is no need to TI this, no matter what the client thinks!

One more thing, if I have a dimension with one consolidated element I will create that first manually and then TI the for any updates etc.
msrao186
Posts: 4
Joined: Mon Jan 09, 2017 9:26 am
OLAP Product: Cognos
Version: 10.2.2
Excel Version: 10

Re: How do I write a TI code in Prolog tab for my requirement?

Post by msrao186 »

Mark RMBC wrote:I don’t know about anyone else but for example, I have a model with 30 dimensions and I think I am safe to say that no 2 dimensions are built in the same way!

Some just add an element to the top consolidated level, others delete all the consolidated levels on the prolog and then rebuild the hierarchy again on the metadata, others create subsets as part of the build and some create the attributes. On one I use the Prolog to build the hierarchy by doing a while loop over the dimension, but that is another story. So I would say you need to think very carefully about how to future proof your dimension builds.

Also, in my opinion if you have a static dimension that will never change and only has a few elements within it then there is no need to TI this, no matter what the client thinks!

One more thing, if I have a dimension with one consolidated element I will create that first manually and then TI the for any updates etc.
Thank you Mark.! for sharing you view point and appreciate your time for responding to my query.
Post Reply