after using subst the asciioutput is not skipping zeroes

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

after using subst the asciioutput is not skipping zeroes

Post by AnonimusMax »

Hi,

I have the following problem.
I am using a executecommand to run a process that is using ASCIIOUTPUT to generate an export.
This export is returning the values with comma ( ex: 0,34566 ). If i run the process with executeProcess the value is returned with . ( ex : 0.34566).
But i don t want to use ExecuteProcess because it depends on the settings that every user has on his computer.

As a solution I used SUBST() and SCAN() to replace the , with . from the value inside the TI process. But when I do this the export now generates the lines with '0' also. I used ViewExtractSkipZeroesSet, and if i don t use SUBST and SCAN the export is correct.
How can I solve this? Or is there another way to make the export not generate the values with Comma?

Thank you,
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: after using subst the asciioutput is not skipping zeroes

Post by Steve Rowe »

Check this function in the help.

DatasourceASCIIDecimalSeparator

pretty sure this works with exports as well.
Technical Director
www.infocat.co.uk
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: after using subst the asciioutput is not skipping zeroes

Post by AnonimusMax »

Hi,

Thank you for your reply but I used all that functions like DatasourceASCIIDecimalSeparator and they don t work.

Thank you,
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: after using subst the asciioutput is not skipping zeroes

Post by Alan Kirk »

AnonimusMax wrote: I have the following problem.
I am using a executecommand to run a process that is using ASCIIOUTPUT to generate an export.
This export is returning the values with comma ( ex: 0,34566 ). If i run the process with executeProcess the value is returned with . ( ex : 0.34566).
But i don t want to use ExecuteProcess because it depends on the settings that every user has on his computer.

As a solution I used SUBST() and SCAN() to replace the , with . from the value inside the TI process. But when I do this the export now generates the lines with '0' also. I used ViewExtractSkipZeroesSet, and if i don t use SUBST and SCAN the export is correct.
How can I solve this? Or is there another way to make the export not generate the values with Comma?
I'm afraid that the above doesn't make any sense to me, or at the very least suggests that we are missing something critical. There is no way that doing a Scan and Subst will cause the source view to change. But what MIGHT be happening is that you're making a mistake in your code which is causing the value to be converted into a zero when you output it.

First, what is the data source for this process?

I'm assuming that it's a cube view. I would further assume that the values in that view are N types, not S's. In which case the values that will be returned be numerics (which do not have formatting embedded in them) and either:
- You have to explicitly convert the value into a string so that you can feed it to the AsciiOutput function, which only accepts strings; OR
- You have to use the implicit SValue variable, which does have formatting.

If it's the first, are you using the NumberToStringEx function? If not, you should be.
If it's the second, and the strings are not in the format that you want for the output... then see the first.

Getting the value as a string and then parsing it isn't the way to go. Using NumberToStringEx to format it is.

But that's IF I've guessed correctly.
"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.
AnonimusMax
Posts: 60
Joined: Thu Nov 17, 2016 2:13 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: after using subst the asciioutput is not skipping zeroes

Post by AnonimusMax »

Hi,

yes, your assumption was correct. I am converting the values into string with numberttostring. ( this is generating an export where the numbers are with comma 0,34566)
I also tried NumberToStringEx ( the numbers are generated with '.' but the export is not correct , i ve described the problem above)
I did a test. I only exported a column with a numeric value ( ex :0.34566 ) and the export shows like this :
0.34566
(empty)
(empty)

0.5677
2.4455

1.4999
Using NumberTostringEx, subst(), scan(). with all of this i have the same result( empty spaces , if i export only this column , 0 if i export all the fields) . And if i export the value only with NumbertTostring, the export looks fine. But the values from the export have comma.
Post Reply