Page 1 of 1

ASCIIOUTPUT to include column headers?

Posted: Wed Mar 13, 2013 4:25 pm
by jimicron
Hi all,

I am trying to export my TM1 cube (simple attributes cube) but it is not including column headers :( I have been looking around in here and found a post that I thought would be helpful since it resolved the other members same issue. Here is that post:

http://www.tm1forum.com/viewtopic.php?f=3&t=3245

However, I have done the same and it's not working :(

Here is exactly what I have done:

Prolog Tab:

Code: Select all

Header = 1;
Data Tab:
(please note I use a full UNC path and not "file path" - I have stated that there for simplicity instead of a lengthy filepath)

Code: Select all

IF (Header = 1);

ASCIIOUTPUT('\\file path\SSD MPN Export.csv', vSSDMPN, vInclusionFlag, vSSDModel, vTotalGBperSSD, vModuleFormFactorPrefix, vModuleFormFactor, vDID, vDensityperIndividualNANDGb, vTotalGigabitsperSSD, vTotalNANDDie, vSeries, vSSDModelandDID, vUsableGBperSSD, vMemoryComponentQuantity, vProductSubtechnology, vNANDInterface, vUsageType );

Header = Header - 1;
ENDIF;
The process runs without error, but when it's done and I look at the .csv, there are no headers :(
And, there is only one line of data :( The cube has about 400 lines in it so I need those 400 lines.

Here is what it looks like:

Thanks again for guidance!!

Re: ASCIIOUTPUT to include column headers?

Posted: Wed Mar 13, 2013 5:29 pm
by tomok
Where are the code statements that are supposedly going to write out the header? The only ASCIIOUTPUT statement I see looks like it is using variable values to output. To write out headers you would need a separate ASCIIOUTPUT statement inside the IF condition.

Code: Select all

IF (Header = 1);
    ASCIIOUTOUT('\\file path\SSD MPN Export.csv','Header1','Header2','Header3'............
ENDIF;
ASCIIOUTPUT('\\file path\SSD MPN Export.csv', vSSDMPN, vInclusionFlag, vSSDModel, vTotalGBperSSD, vModuleFormFactorPrefix, vModuleFormFactor, vDID, vDensityperIndividualNANDGb, vTotalGigabitsperSSD, vTotalNANDDie, vSeries, vSSDModelandDID, vUsableGBperSSD, vMemoryComponentQuantity, vProductSubtechnology, vNANDInterface, vUsageType );
Header = Header - 1;

Re: ASCIIOUTPUT to include column headers?

Posted: Wed Mar 13, 2013 6:04 pm
by jimicron
:oops: Thanks!! Didn't know that. That other thread didn't mention that. So, have added per how you stated putting the column header names in single quotes and voila - worked perfectly!

Thanks a lot for your help! Appreciate it!