Please help in exporting the data using TI in table layout

Post Reply
Ashleigh W
Posts: 88
Joined: Mon Oct 24, 2016 1:21 pm
OLAP Product: TM1
Version: TM1 Perspectives 10
Excel Version: Excel 2016

Please help in exporting the data using TI in table layout

Post by Ashleigh W »

Hi everyone, please help in exporting the data using TI in table layout.
The TI process I have attached duplicates or creates extra line for number of variables I have declared / lookup.
Please help me.

Thanks,
Ashleigh

Current output 201002 UK CLT001 100000 -800 99200 201002 UK CLT001 100000 -800 99200 201002 UK CLT001 100000 -800 99200 201002 UK CLT002 100000 -800 99200 201002 UK CLT002 100000 -800 99200 201002 UK CLT002 100000 -800 99200 201002 UK CLT003 100000 -800 99200 201002 UK CLT003 100000 -800 99200 201002 UK CLT003 100000 -800 99200 201002 UK CLT004 100000 -800 99200 201002 UK CLT004 100000 -800 99200 201002 UK CLT004 100000 -800 99200 201002 AUS CLT001 100005 -859 99146 201002 AUS CLT001 100005 -859 99146 201002 AUS CLT001 100005 -859 99146

Output expected 201002 UK CLT001 100000 -800 99200 201002 UK CLT002 100000 -800 99200 201002 UK CLT003 100000 -800 99200 201002 UK CLT004 100000 -800 99200 201002 AUS CLT001 100005 -859 99146 201002 AUS CLT002 100005 -859 99146 201002 AUS CLT003 100005 -859 99146 201002 AUS CLT004 100005 -859 99146

Code: Select all




#****Begin: Generated Statements***
#****End: Generated Statements****

#IN DATA TI TAB

xNetIn = CELLGETN(cubTarget, var_Period,var_REG, var_Clients,'NetIn');
xNetOut= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NetOut');
xnnb= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NNB');

ASCIIOutput(Var_Outputfile, var_Period,var_REG, var_Clients,  NUMBERTOSTRING(xNetIn), NUMBERTOSTRING(xNetOut),NUMBERTOSTRING(xnnb));
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Please help in exporting the data using TI in table layout

Post by Edward Stuart »

Amend your datasource so it does not contain duplicates or amend your ASCIIOUTPUT to ignore duplicates
Ashleigh W
Posts: 88
Joined: Mon Oct 24, 2016 1:21 pm
OLAP Product: TM1
Version: TM1 Perspectives 10
Excel Version: Excel 2016

Re: Please help in exporting the data using TI in table layout

Post by Ashleigh W »

hi Edward, thanks for quick reply. The source is the Cube Viewer view which is created and saved for public use. and when I manually view this from Cube Viewer data alignment looks perfect. I am new to TI and my guess is below lines are creating duplication because data tab runs for all recs in source.
Please guide me on how to correct this. thanks again.

Code: Select all

xNetIn = CELLGETN(cubTarget, var_Period,var_REG, var_Clients,'NetIn');
xNetOut= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NetOut');
xnnb= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NNB');
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Please help in exporting the data using TI in table layout

Post by Edward Stuart »

I'd suggest reading the Turbo Integrator Guide as a point of focus for this query, however, the thrust of it is:

Turbo Integrator Guide, Page 11 - Order of Operations within a TurboIntegrator Process
5. All lines in the Data procedure are sequentially executed against the first record
in the data source. All lines are then sequentially executed against the second
record in the data source, and so on until all records are processed.
Each ASCIIOUTPUT statement is processed per line in the datasource, therefore your datasource likely contains multiple hierarchies

Just because what you can 'see' in a CubeView is what you think you want. It isn't what the TI will process

My guess is you have multiple hierarchies in the var_Period or var_Clients dimensions but we can't tell from the information provided
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Please help in exporting the data using TI in table layout

Post by Wim Gielis »

I bet your source view contains 3 measures.
Hence, 3 times the same output record.
Stick with 1 measure that is always filled in, and do CellGetN towards the other 2 measures.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Please help in exporting the data using TI in table layout

Post by Edward Stuart »

Good catch Wim, that is much more likely
Ashleigh W
Posts: 88
Joined: Mon Oct 24, 2016 1:21 pm
OLAP Product: TM1
Version: TM1 Perspectives 10
Excel Version: Excel 2016

Re: Please help in exporting the data using TI in table layout

Post by Ashleigh W »

Wim Gielis wrote:I bet your source view contains 3 measures.
Hence, 3 times the same output record.
Stick with 1 measure that is always filled in, and do CellGetN towards the other 2 measures.
Hi Wim, guys, as rightly pointed out by Wim I removed 2 sub-elements from my prolog tab and now I have the desired output.
thanks Wim and everyone for your help/contribution.

below is my final TI Script

Code: Select all

#---------------------------------
PROLOG tab
dimTarget = 'xDIM_measure_NAME';
IF( SUBSETEXISTS( dimTarget , subTemp ) = 1 );
   SUBSETDELETEALLELEMENTS( dimTarget , subTemp );
ELSE;
   SUBSETCREATE( dimTarget , subTemp );
ENDIF;

#SUBSETELEMENTINSERT( dimTarget , subTemp , 'NetIn' , 0 );
#SUBSETELEMENTINSERT( dimTarget , subTemp , 'NetOut' , 0 );
SUBSETELEMENTINSERT( dimTarget , subTemp , 'NNB' , 0 );

VIEWSUBSETASSIGN( CurrentCube , vuetemp , dimTarget , subTemp );

Code: Select all

#DATA tab

xNetIn = CELLGETN(cubTarget, var_Period,var_REG, var_Clients,'NetIn');
xNetOut= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NetOut');
#xnnb= CELLGETN(cubTarget, var_Period,var_REG, var_Clients, 'NNB');

ASCIIOutput(Var_Outputfile, var_Period,var_REG, var_Clients,  NUMBERTOSTRING(xNetIn), NUMBERTOSTRING(xNetOut),NUMBERTOSTRING(var_value));
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Please help in exporting the data using TI in table layout

Post by Wim Gielis »

Good ! :-)
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply