ASCIIOutput Formatting

Post Reply
csfox1218
Posts: 1
Joined: Thu Oct 22, 2009 2:35 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 12

ASCIIOutput Formatting

Post 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.
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: ASCIIOutput Formatting

Post 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!
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: ASCIIOutput Formatting

Post 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
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: ASCIIOutput Formatting

Post 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.
Post Reply