ASCII output

Post Reply
ravi
Posts: 138
Joined: Mon Apr 26, 2010 12:39 pm
OLAP Product: cognos
Version: tm1 9.5
Excel Version: 2007

ASCII output

Post by ravi »

Hi All,

We are trying call ASCII output for each time we do cube data Zero- out.
Included-date, username that executed, and what version and years that were zeroed out.

Attached is the script-

Here are hardcoding the Year values to delete or zero-out data currenly available servions in cube.

Please suggest- can we use any dynamic steps to avoid scripting or hardcoding for years (dimemsion) - can we try creating subset that delete version data for Exmaple:

For the Actuals version => zero out all data that are NOT under 2013 year.
For all other versions => zero out all data that are NOT for the year that the version pertains too.

Some examples:
For ‘Forecast’ cube and version ‘Actuals’ zero out all data for prior years: 2009,2010,2011,2012.
For ‘Historical Forecast’ cube and version ‘FY11 Actuals Archived’ zero out all data for prior years: 2009,2010.
For ‘Historical Forecast’ cube and version ‘FY12 Actuals Archived’ zero out all data for prior years: 2009,2010,2011.

Regards,
Ravi
Attachments
ASCII output if we passed Version as ACtuals.docx
(11.05 KiB) Downloaded 378 times
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: ASCII output

Post by Martin Ryan »

I'd create the subset then use that to do the export. E.g.

Code: Select all

SubsetCreate(sDim, sSubset);
if(sScenario@='Actual');
subsetelementinsert(sDim, sSubset, '2009', 1);
subsetelementinsert(sDim, sSubset, '2010', 2);
subsetelementinsert(sDim, sSubset, '2011', 3);
elseif(sScenario@='Budget');
subsetelementinsert(sDim, sSubset, '2009', 1);
subsetelementinsert(sDim, sSubset, '2010', 2);
elseif(sScenario@='Whatever);
subsetelementinsert(sDim, sSubset, '2009', 1);
subsetelementinsert(sDim, sSubset, '2010', 2);
endif;

yearString='';
i=subsetsiz(sDim, sSubset); # or subsetgetsize, I can't remember
while(i<0);
sElem=subsetgetelement(sDim, sSubset, i); # pretty sure this isn't the right function name, you'll need to find it
yearString=sElem | ', ' | yearString;
i=i-1;
end;

sFile='C:\path\myFile.csv';
asciioutput(sFile, 'Other information', yearString);
That's just the bare bones, there'll be a bit more to it. But the point is you can then use that subset for creating the view to zero out, and also to spit out the information to the flat file.
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
sathishh.mk
Posts: 38
Joined: Mon Dec 20, 2010 5:02 am
OLAP Product: Cognos TM1
Version: 9.4 and 9.5
Excel Version: 2003 and 2007

Re: ASCII output

Post by sathishh.mk »

Hi Martin,

After changing little ASCII code It is working as expected.
Thanks for the help.

Modified code for ASCII Out put:

yearString='';
i = SubsetGetSize('Year', vZero_Test);
while(i>0);
sElem=SubsetGetElementName('Year', vZero_Test, i);
yearString=sElem | ', ' | yearString;
i=i-1;
end;

Regards,
Sathish
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: ASCII output

Post by tomok »

Ravi/Satish, why do you post under two different IDs?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
sathishh.mk
Posts: 38
Joined: Mon Dec 20, 2010 5:02 am
OLAP Product: Cognos TM1
Version: 9.4 and 9.5
Excel Version: 2003 and 2007

Re: ASCII output

Post by sathishh.mk »

Hi,

We unknowly duplicated the post.Sorry for duplicating.
In future,we will not repeat the same.
sorry for the inconvenience caused.

Regards,
Sathish
Post Reply