Page 1 of 1

ASCII output

Posted: Mon Dec 24, 2012 10:22 am
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

Re: ASCII output

Posted: Thu Dec 27, 2012 12:26 am
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.

Re: ASCII output

Posted: Thu Dec 27, 2012 10:50 am
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

Re: ASCII output

Posted: Thu Dec 27, 2012 3:40 pm
by tomok
Ravi/Satish, why do you post under two different IDs?

Re: ASCII output

Posted: Tue Jan 08, 2013 1:57 pm
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