Page 1 of 1

after using subst the asciioutput is not skipping zeroes

Posted: Tue Jan 17, 2017 9:15 am
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,

Re: after using subst the asciioutput is not skipping zeroes

Posted: Tue Jan 17, 2017 9:28 am
by Steve Rowe
Check this function in the help.

DatasourceASCIIDecimalSeparator

pretty sure this works with exports as well.

Re: after using subst the asciioutput is not skipping zeroes

Posted: Tue Jan 17, 2017 9:31 am
by AnonimusMax
Hi,

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

Thank you,

Re: after using subst the asciioutput is not skipping zeroes

Posted: Tue Jan 17, 2017 9:56 am
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.

Re: after using subst the asciioutput is not skipping zeroes

Posted: Tue Jan 17, 2017 10:48 am
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.