Cube data extract with"semi colon" separted values

Post Reply
SBK88
Posts: 45
Joined: Fri Apr 17, 2015 5:55 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2013

Cube data extract with"semi colon" separted values

Post by SBK88 »

Hi friends,

Need your help
I want to extract a cubes data into a csv file with the values being separated by "semi colon" instead of "commas".
Also to have column header too ( dimension name as heading for each column).
Ex.

Products;Countries;Value;
abc;sweden;10;
xyz;china;20;


I was trying ASCIIOutput and TextOutput Functions .

Suggest me some solution.

Thanks.
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Cube data extract with"semi colon" separted values

Post by Alan Kirk »

SBK88 wrote: I want to extract a cubes data into a csv file with the values being separated by "semi colon" instead of "commas".
In the Prolog, set the following value:

Code: Select all

DatasourceASCIIDelimiter=';';
SBK88 wrote: Also to have column header too ( dimension name as heading for each column).
Ex.
Products;Countries;Value;
abc;sweden;10;
xyz;china;20;


I was trying ASCIIOutput and TextOutput Functions .
In the Prolog, enter the following:

Code: Select all

lRow=0;
As the first line in the Data tab, enter the following:

Code: Select all

lRow = lRow + 1;
After that, put an If() block in to write the column headers if, and only if, the row count is 1. Something like this:

Code: Select all

# Print headings on first row only.
# Note the outputs are literal strings, not variables.
If (  lRow = 1);
    AsciiOutput( SC_FILENAME, 'V1', 'V2', 'V3', 'V4', 'V5', 'Value' );
EndIf;
After that, write the data using your normal AsciiOutput or TextOutput function, as the case may be.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
SBK88
Posts: 45
Joined: Fri Apr 17, 2015 5:55 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2013

Re: Cube data extract with"semi colon" separted values

Post by SBK88 »

Thanks Alan,

I am having one more issue, all the values are coming in double quotes
ex. "abc";"40.40";

How to remove this double quotes from each values.

Thanks
User avatar
gtonkin
MVP
Posts: 1265
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: Cube data extract with"semi colon" separted values

Post by gtonkin »

Have a look in the reference guide for DatasourceAsciiDelimiter and this should give you a link to other TurboIntegrator Local Variables and the one you need.
BR, George.

Learn something new: MDX Views
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Cube data extract with"semi colon" separted values

Post by Alan Kirk »

What George said. We keep a link to the most recent version of the Reference Guide in the FAQ since it's the single most useful piece of documentation there is, but for brevity the 10.2 one is here.

You should definitely browse through it periodically to keep up to date with the functions that are available to you.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Cube data extract with"semi colon" separted values

Post by lotsaram »

SBK88 wrote:Hi friends,

Need your help
I want to extract a cubes data into a csv file with the values being separated by "semi colon" instead of "commas".
Also to have column header too ( dimension name as heading for each column).
Ex.

Products;Countries;Value;
abc;sweden;10;
xyz;china;20;


I was trying ASCIIOutput and TextOutput Functions .

Suggest me some solution.

Thanks.
Hi sbk88,
I'm just wondering are you an end user an IT admin or a TM1 consultant?
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Post Reply