Page 1 of 1

Please help in exporting the data using TI in table layout

Posted: Tue Oct 25, 2016 6:02 am
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));

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

Posted: Tue Oct 25, 2016 8:26 am
by Edward Stuart
Amend your datasource so it does not contain duplicates or amend your ASCIIOUTPUT to ignore duplicates

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

Posted: Tue Oct 25, 2016 8:31 am
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');

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

Posted: Tue Oct 25, 2016 10:26 am
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

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

Posted: Tue Oct 25, 2016 10:46 am
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.

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

Posted: Tue Oct 25, 2016 10:54 am
by Edward Stuart
Good catch Wim, that is much more likely

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

Posted: Tue Oct 25, 2016 12:44 pm
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));

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

Posted: Tue Oct 25, 2016 1:20 pm
by Wim Gielis
Good ! :-)