CSV export problem

Post Reply
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

CSV export problem

Post 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 :)
Wim Gielis
MVP
Posts: 3234
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: CSV export problem

Post by Wim Gielis »

Did you have a look at this in TI ? For example:

DatasourceASCIIDelimiter = Char(9);
DatasourceASCIIQuoteCharacter = '';
DatasourceASCIIDecimalSeparator = ',';
DatasourceASCIIThousandSeparator = '';
DatasourceASCIIHeaderRecords = 1;
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
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: CSV export problem

Post 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.
User avatar
gtonkin
MVP
Posts: 1261
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: CSV export problem

Post by gtonkin »

It may be worthwhile checking/changing the decimal symbol in the Regional settings for the user who starts your TM1 instance.
BR, George.

Learn something new: MDX Views
lotsaram
MVP
Posts: 3703
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: CSV export problem

Post 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
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: CSV export problem

Post 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,
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: CSV export problem

Post by AnonimusMax »

Hi,

Anyone has another solution?

Thank you
Piotr Rajtar
Posts: 2
Joined: Tue Mar 04, 2014 8:07 am
OLAP Product: TM1
Version: 10.1 - 10.3
Excel Version: 2013
Location: Warsaw, Poland

Re: CSV export problem

Post 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.
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: CSV export problem

Post 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
Post Reply