Page 1 of 1

View Zerout and Ascii out put for log

Posted: Mon Dec 24, 2012 10:59 am
by sathishh.mk
Hi All,

we have a requirement to Create/ zeroout the views,After zero outing we need to delete the Views
We have 14 dimension in the cube.

Here is the criteria to Zeroout.

We have Version dimension with different versions and year dimension starting the years with 2008 to 2013.
Version Dimension having elements: like Actuals,FY11 Actuals Archived,FY12 JanOL..etc

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,2012
For ‘Historical Forecast’ cube and version ‘FY12 Actuals Archived’ zero out all data for prior years: 2009,2010,2011.

in the above example user can enter the ‘FY11 Actuals Archived’ version as parameter then TI has build the viewS for the below combination and view zero out.

Cubename Version Year
Historical Forecast FY11 Actuals Archived 2008
Historical Forecast FY11 Actuals Archived 2009
Historical Forecast FY11 Actuals Archived 2010
Historical Forecast FY11 Actuals Archived 2012

And also we need to have some calls to a small log with asciioutput(), nothing too fancy. A log with the date, username that executed, and what version and years that were zeroed out. A unique log filename for each run would be preferred.

I created TI process with attached script and working as expected.
We are passing Cubename,Version Dim name,Version element to be deleted as Parameters and we hard coded Years.
Based on the Version element parameter it is validating Year and inserting the year elements in the new year_subset.
But we are looking for Dynamic Year subset creation and view zero out and Log with dynamic subset year elements.

Please help us.
Thanks in Advance !!

Regards,
Sathish

Re: View Zerout and Ascii out put for log

Posted: Mon Dec 24, 2012 12:16 pm
by Wim Gielis
Hello

What is the difference with your previous topic:
http://www.tm1forum.com/viewtopic.php?f=3&t=8331

Re: View Zerout and Ascii out put for log

Posted: Wed Dec 26, 2012 4:16 am
by sathishh.mk
Hi Wim,

Previous explains the requirement and this post explains my implementaion steps.
And i am asking some help on Dynamic subeset creation based on logic.
Let me know if i missed any thing/any info to provide further.

Regards,
Sathish

Re: View Zerout and Ascii out put for log

Posted: Wed Dec 26, 2012 11:51 am
by Wim Gielis
Here is example coding for your dynamic subset:

Code: Select all

pVersion = 'FY11 Actuals Archived';

SubsetCreateByMdx('test subset','{EXCEPT({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Years] )}, 0)},{StrToMember("[Years].[Y20" + "' | Subst(pVersion,3,2) | '" + "]")} )}');
My dimension Years contains n-type elements Y2008, Y2009, Y2010, Y2011, Y2012, Y2013.

The result of the subset is all years, except Y2011.
You can tweak this in your TI process.

PS: Please use only 1 topic in the future since that would not clutter the forum. Thanks.

Re: View Zerout and Ascii out put for log

Posted: Wed Dec 26, 2012 4:13 pm
by Wim Gielis
Alternatively, you can use the code to have a dynamic subset with lowest-level elements:

{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Years] )}, 0)}

followed by a SubsetElementDelete command to remove the year you do not want in the subset.
By the way, this will turn the dynamic subset into a static subset.

Re: View Zerout and Ascii out put for log

Posted: Wed Dec 26, 2012 4:21 pm
by Wim Gielis
And this topic is also very similar?

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

Oh boy.

Re: View Zerout and Ascii out put for log

Posted: Thu Dec 27, 2012 10:46 am
by sathishh.mk
Hi Wim,

I included the script for Version=Actuals as well.
Its working as expected.
Heartful Thanks to you for the help.
I am attaching the modified Script for your reference!!

Once again Thanks for the help.

Regards,
Sathish

Re: View Zerout and Ascii out put for log

Posted: Tue Jan 08, 2013 1:54 pm
by sathishh.mk
Hi ,

I am using attached codes for Zero out the cube views,but i am unlucky to achieve the same.
Can you some one help me whether i am doing any mistake in the code or in any other.

Attachment1: code for only specified elements in the dimension and creating view with specified elements dimension and rest dimensions will have all the elements.

Attachment2: I checked by creating all dimensions at leaf level and trying to zero out,still no luck.

Regards,
Sathish