Page 1 of 1

CSV export problem

Posted: Thu Jan 05, 2017 1:56 pm
by AnonimusMax
Hi, I have another problem.

I have a TI process that generates a .CSV file.
This TI process is executed using ExecuteCommand and a technical user.
If I execute this process using my user (local settings in Windows is set to English) all the values are exported using dot decimals. For example: 120.34
If I use this technical user, the exported value will be: 120,34
This is a issue for the performed export because intead of 1 column, using technical user will result in 2 columns.
I have tried to change the local setting for this technical user, but is defined just in Cognos, and not in Windows.
Is there a way to control the export?
Please note that I use as data source a TM1 cube.

Thank you :)

Re: CSV export problem

Posted: Thu Jan 05, 2017 2:29 pm
by Wim Gielis
Did you have a look at this in TI ? For example:

DatasourceASCIIDelimiter = Char(9);
DatasourceASCIIQuoteCharacter = '';
DatasourceASCIIDecimalSeparator = ',';
DatasourceASCIIThousandSeparator = '';
DatasourceASCIIHeaderRecords = 1;

Re: CSV export problem

Posted: Thu Jan 05, 2017 3:27 pm
by AnonimusMax
Hi,

i have used this and it is not working. also with '.', ',';
DatasourceASCIIDelimiter = Char(9);
DatasourceASCIIQuoteCharacter='';
DataSourceASCIIDecimalSeparator='.';
DatasourceASCIIThousandSeparator='';

0,002877239
0,4165

The values are still exported with comma delimiter...
I have this problem only when running this with ExecuteCommand.

Re: CSV export problem

Posted: Thu Jan 05, 2017 7:10 pm
by gtonkin
It may be worthwhile checking/changing the decimal symbol in the Regional settings for the user who starts your TM1 instance.

Re: CSV export problem

Posted: Thu Jan 05, 2017 8:29 pm
by lotsaram
1/ You haven't said how you are doing the number to sting conversion; NumberToString, NumberToStringEx or Str. You haven't said whether you are using AsciiOutput or TextOutput. That would both seem to be pretty important information.

2/ I recall having seen something similar and I think there is already an existing APAR for this issue

Re: CSV export problem

Posted: Fri Jan 06, 2017 11:18 am
by AnonimusMax
Hi,

i am using AsciiOutput and NumberToString.
Do you have the link ? because I didn t find the existing APAR for this issue.

Thank you,

Re: CSV export problem

Posted: Tue Jan 10, 2017 12:39 pm
by AnonimusMax
Hi,

Anyone has another solution?

Thank you

Re: CSV export problem

Posted: Thu Jan 12, 2017 5:01 pm
by Piotr Rajtar
AnonimusMax wrote:i am using AsciiOutput and NumberToString.
Try using NumberToStringEx instead to explicitly specify decimal character:

Code: Select all

# adjust precision to your needs
sFormatString = '#.####';
sDecimalSeparator = '.';
sThousandsSeparator = '';
sValue = NumberToStringEx(nValue, sFormatString, sDecimalSeparator, sThousandsSeparator);
NumberToString will implicitly use the regional settings of the user executing the TI process. I am not sure whether it is by design or a bug but I remember it changed at some point and even one of the TM1 Application Web TI processes (}tp_util_update_hierarchy) was prone to this behavior.

Re: CSV export problem

Posted: Tue Jan 17, 2017 9:47 am
by AnonimusMax
Yes, this is working thank you,

Nut now this is creating another problem, I am using ViewExtractSkipZeroesSet and if i use NumbertostringEX now the export is generating also the lines with '0'.
Before I used this replace the export was generated with out zeroes.

Thank you