Page 1 of 1
ASCIIOutput Formatting
Posted: Wed Apr 21, 2010 8:04 pm
by csfox1218
Does anyone know how to group/sort data when exporting using the ASCIIOutput TI function. For example, I have Location, Cost Center, Account and Time Dimensions. I want the data sorted in that order when it is exported. Is there anyway to do that on the export or does it need to be done after the fact with another tool?
Thanks.
Re: ASCIIOutput Formatting
Posted: Wed Apr 21, 2010 10:06 pm
by lotsaram
Have you read the documentation or checked the syntax on the ASCIIOutput function? I won't reproduce the entire section but the answer to your question should be obvious from the syntax alone ....
ASCIIOutput(FileName, String1, String2, ...Stringn);
The only one deciding the order of output is the person writing the code!
Re: ASCIIOutput Formatting
Posted: Wed Apr 21, 2010 10:13 pm
by Martin Ryan
I think s/he is referring to the order of the rows, not the columns.
There's no easy way to do this. If you manually
create your view in the Prolog tab then you can specify the order of the rows and dimensions in the view. I can't remember the TI function off the top of my head, but it's in the doco. I've had limited success with it though.
You
could write a TI process that used "While" to loop through all elements in the Location dimension, then the elements in the Cost Centre dimension, then the elements in the Account dimension all in the Prolog tab then asciioutput then number you found nested at the bottom of all those loops. The process would be very slow though.
Martin
Re: ASCIIOutput Formatting
Posted: Wed Apr 21, 2010 10:30 pm
by lotsaram
Martin Ryan wrote:I think s/he is referring to the order of the rows, not the columns.
Didn't read that way to me but I agree that's how I would
prefer to read the question. The only way to foolproof this would be to
EITHER
create subsets in each dimension in the correct order, then assign the dimensions to rows in the correct order then use that view as the data source
OR
as Martin suggested a nested while loop through each dimension
The nested while loop option would most likely be easier to write but would perform much slower.