Page 1 of 1
Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 12:38 am
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.
Re: Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 1:04 am
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:
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:
As the first line in the Data tab, enter the following:
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.
Re: Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 3:52 am
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
Re: Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 4:00 am
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.
Re: Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 5:48 am
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.
Re: Cube data extract with"semi colon" separted values
Posted: Tue Nov 03, 2015 7:27 am
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?