Page 1 of 1

Cellgetn and asciioutput

Posted: Fri Aug 08, 2014 7:21 pm
by bjones
Hello all,

sort of new to ti processes and stuck.

i'm trying to export a cube that has comments and match those same cell to their value which is stored in another cube.
So far i have the following command but it is not working

ASCIIOUTPUT('C:\...\fil.csv', V1, V2, V3, V4, V5, V6, value, cellgetS('PNLCube', V2, V3, V4, V5) );

Pretty much what i'm trying to get as an output is:
V1 V2 V3 V4 V5 V6 value and the other corresponding value in PNLCUBE

Any help or guidance towards the right direction would be appreciated

thanks

Re: Cellgetn and asciioutput

Posted: Fri Aug 08, 2014 7:27 pm
by Alan Kirk
bjones wrote: sort of new to ti processes and stuck.

i'm trying to export a cube that has comments and match those same cell to their value which is stored in another cube.
So far i have the following command but it is not working

ASCIIOUTPUT('C:\...\fil.csv', V1, V2, V3, V4, V5, V6, value, cellgetS('PNLCube', V2, V3, V4, V5) );

Pretty much what i'm trying to get as an output is:
V1 V2 V3 V4 V5 V6 value and the other corresponding value in PNLCUBE

Any help or guidance towards the right direction would be appreciated
From the Request For Assistance Guidelines:
RFAG wrote: 4) Similarly if you're getting unexpected results, specifics of what you're running, how, and what results you're getting will yield a more valuable response than "I'm running a T.I. but my code doesn't work properly". If you're getting an error, please be specific about what the error is (full details, not just "a runtime error" or "process terminated with errors"), and the circumstances under which it's occurring.
I can make a guess, but in the absence of specifics it's only a guess.

You have Value as one of the arguments. I'm assuming that the data source is a cube view and that Value is numeric.

All of the arguments that you pass to AsciiOutput need to be strings. It doesn't do an implicit conversion of numeric to string. Accordingly you would need to wrap a conversion function like the Rules function Str() or the TI functions NumberToString or NumberToStringEx around Value to convert it.

All of this is based on the assumption that 'PNLCube' is the one that contains the comment, not the value. If that's not the case (and I would have expected something named PNLCube to have numbers rather than or in addition to comments) then you have things the wrong way around. If the data source is in fact the cube which has comments then Value will already be a string. You'd therefore need to be using CellGetN, not CellGetS, to get the value from PNLCube, then convert that to a string using one of the functions that I described above. CellGetN points to numeric cells and CellGetS to string cells; they don't convert the values that they retrieve into numbers or strings, as the case may be.

Re: Cellgetn and asciioutput

Posted: Fri Aug 08, 2014 7:59 pm
by bjones
Thanks Alan,

Just read through the guidelines.

You're right it was a string vs number issue. the value is actually a string is the other value i get cellgetS that was a numeric. just added numbertostring

Thanks a lot