Page 1 of 1

ASCIIOUTPUT not giving negative data

Posted: Tue Apr 17, 2012 12:04 pm
by anoops81
Hi All ,

I have a TI which exports the data into a text file.

The following is the TI script

Code: Select all

ASCIIOUTPUT('\\TM1\WS\expenseload2UCS\expenseload2UCS_V1.txt',RC,RL,P0,P2,V9,mon,V2)
The TI is running successfully but negative numbers are displayed as positive in the file.

Is this a limitation in ASCIIOUTPUT , because it treats all the vairables as strings ?

When I check in the cube I can see the negative entry for the report line , but the same is displayed as postive entry in export file. The file is of 66 KB , hence I hope it is not truncating any info.

Appreciate your response !!!

Regards
Anoop

Re: ASCIIOUTPUT not giving negative data

Posted: Tue Apr 17, 2012 12:22 pm
by tomok
anoops81 wrote:Is this a limitation in ASCIIOUTPUT , because it treats all the vairables as strings ?
TM1 does not treat variables as strings, you have to explicitly convert numeric variables to strings yourself in code before writing them out via the ASCIOUTPUT function, or they have to be defined as strings in the Variables tab. Which one did you do and which of the variables from your function contain the numeric values. If you specified the variable as a string in the variables tab then TM1 will include the minus sign (if there indeed is one). You must have not done this. In that case where is the code you wrote to convert the numeric variable to a string?

Re: ASCIIOUTPUT not giving negative data

Posted: Tue Apr 17, 2012 12:40 pm
by anoops81
Tomok,

Value is defined as Numeric in variables tab.

v2=STR(Value,10,8);

ASCIIOUTPUT('\\TM1\WS\expenseload2UCS\expenseload2UCS_V1.txt',RC,RL,P0,P2,V9,mon,V2);


Thats all I have in the TI .


Regards,
Anoop

Re: ASCIIOUTPUT not giving negative data

Posted: Tue Apr 17, 2012 12:43 pm
by rmackenzie
anoops81 wrote:v2=STR(Value,10,8);
Try:

Code: Select all

v2=NumberToString(Value);

Re: ASCIIOUTPUT not giving negative data

Posted: Tue Apr 17, 2012 2:16 pm
by anoops81
Thanks a lot Mckanzie & Tomok !!!

Code: Select all

v2=NumberToString(Value);
worked.

I was stuck for a day with this !!


Regards
Anoop