IBM Turbointegrator

Post Reply
panaru
Posts: 3
Joined: Mon Jan 09, 2017 9:02 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2010

IBM Turbointegrator

Post by panaru »

I am using TM1 Turbointegrator for the first time .
I have a Cube with 2 Dimensions TextRange, TextAnalysis and TextFrequency
I am using Version 9.5.2 TM1 perspectives.

Under Text Range i have 23 Elements which i created Manually while creating the Dimension TextRange.

I am done with the Data Input. I am manually writing the code into Advanced Parameters Tab with Content as Other enabled for the variables(VWord, VFreq).

Along with the Word_Name i need to count the frequency means number of times the word Appears under Word_Count.

The next step is to make a new element in TextAnalysis Dimension with Alias name so that i can generate a new element with the Parameter passed in Parameter Tab.
With each W_001 until W_023 i need to do the Analysis of the word generated. I am bit confused in this scenario.

I have an idea like i can use ATTRS, ATTRPUTS and the concept of Index. Need your expert advice to guide me on this.

Code: Select all

Prolog Section Code:
#****Begin: Generated Statements***
#****End: Generated Statements****


#
#Set parameters and intialize variables
#

MetCnt=0;
DatCnt=0;


nType='N';
sType='S';


tCube='Analysis_Cube';
ParamCube='xParam';

TxtDim='TextRange';
AnaDim='TextAnalysis';
ValDim='TextFrequency';

tElem='Word_Name';
vElem='Word_Count';
aElem='A_001';
bElem='A_002';



#DimensionAttrInsert('','Aliass','A');


tAnaly='pAnalysis';



#tAnaly=DimensionElementPrincipalName(AnaDim, pAnalysis);

# Create new element****

IF(  LONG(tAnaly) =0);
    newElem= DIMSIZ(AnaDim)+1;

sindex='newElem';
sLen=LONG(sindex);
sTxtElem='A_' | FILL('0',3-sLen) | sindex;
      #dimzize +1

      DimensionElementInsert(AnaDim,'','sTxtElem',nType);
ENDIF;


# assign new element to variable aElem*****


index = aElem;
indCount = DIMSIZ(AnaDim);

#WHILE( index < indCount);
#index = index + 1;
#END;


#IF(  LONG(tAnaly) =0);
#sTxtElem = DIMSIZ('AnaDim'+1);

#DimensionElementInsert(AnaDim,'','sTxtElem',nType);
#ENDIF;

# set parameter pAnalysis as alias attribute of new element*****


#DimensionElementPrincipalName - returns the principal name of an element or element alias

#IF( DimIX(AnaDim, aElem) = 0);

#DimensionElementInsert(AnaDim,'',sTxtElem,nType);
#ELSE;
#itemskip;
#ENDIF;

AttrInsert( AnaDim,'Analyss', 'Alias', 'A');
AttrPutS(tAnaly,AnaDim,aElem,'Alias');
Attachments
Structure of Cube.PNG
Structure of Cube.PNG (69.46 KiB) Viewed 2990 times
daniel.havassy
Posts: 30
Joined: Wed Sep 14, 2016 9:26 am
OLAP Product: Planning Analytics Local
Version: 2.0.4
Excel Version: 2016

Re: IBM Turbointegrator

Post by daniel.havassy »

Hi!

Without commenting on what and how you'd like to achieve, I'd like to give you some help with TurboIntegrator (TI) scripting.

First of all, I think you need to understand how the different tabs of the TI editor work. You see, when a TI is executed, it loops through all of your data source records once for the Metadata tab, and then for the Data Tab and executes the code on these tabs for each record. You need to be mindful as to what type of actions you perform on the respective tabs. Put dimension metadata manipulation code on the Metadata tab (for example inserting new dimension elements), and anything that has to do with data, on the Data tab (for example inserting a numeric or string value into a cell in a cube).

What you also need to understand about attributes, is that they are stored in two-dimensional control cubes called }ElementAttributes_DIMENSION (substitutes your dimension name with DIMENSION). So what really happens when you create a new attribute, is that a new dimension element is inserted into the dimension called }ElementAttributes_DIMENSION, and then, when you add an attribute value, a cell value insertion is performed in that cube against a cell that's coordinates are the dimension element to which you want to add an attribute / alias, and the dimension element corresponding to the attribute itself (in the dimension }ElementAttributes_DIMENSION).

Considering the above, you'll need to put the attribute creation code on the Metadata tab, and the attribute value insertion on the data tab.

If you are new to TI, if I were your I'd check the below resources and invest some time in it before you go on:
- If you can get your hands on the book called "IBM Cognos TM1: The Official Guide", work your way through chapter 7 to learn about TI's
- Get familiar with Bedrock, it's an open source TM1 scripting library, and read their white paper on TI scripting (http://www.bedrocktm1.org)
- Always refer to the official TM1 product documentation's (on IBM Knowledge Center) Reference Guide

I hope this helps.
panaru
Posts: 3
Joined: Mon Jan 09, 2017 9:02 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2010

Re: IBM Turbointegrator

Post by panaru »

Thanks Daniel for the explanation :)
I am also going through the docs and understanding them thoroughly.
Post Reply