{"id":68,"date":"2011-04-18T20:24:00","date_gmt":"2011-04-18T20:24:00","guid":{"rendered":"http:\/\/www.sapbpc.sapag.co.in\/?p=68"},"modified":"2011-04-18T20:24:00","modified_gmt":"2011-04-18T20:24:00","slug":"rolling-12-custom-measure-in-bpc-7-x-version-for-ms-and-nw","status":"publish","type":"post","link":"https:\/\/www.sapbpc.sapag.co.in\/?p=68","title":{"rendered":"Rolling 12 Custom Measure in BPC 7.x, version for MS and NW"},"content":{"rendered":"<p>It is not out of the ordinary for a client to want a summation of last 12 months for many accounts.&#160; One way of doing this, if the number of accounts is minimal, is to create several dimension formulas, but this could diminish performance.&#160; A better way of accomplishing this is to create a Custom Measure called Rolling 12.<\/p>\n<p><strong>BPC version for Microsoft<\/strong><\/p>\n<p>In BPC, version for Microsoft, it is fairly straight forward in that the formula for both Periodic and YTD are the same, except for \u201cELSE\u201d statement at the end.<\/p>\n<p>The formula for a Periodic application is as follows:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iif([Account].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;INC&quot; or<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [Account].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;EXP&quot;,sum(LastPeriods<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (12,closingperiod([Time].month)),Measures.[Periodic]),Measures.[Periodic])<\/p>\n<p>For a YTD application:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iif([Account].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;INC&quot; or<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [Account].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;EXP&quot;,sum(LastPeriods<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (12,closingperiod([Time].month)),Measures.[Periodic]),Measures.[YTD])<\/p>\n<p>To test the formula, login into SQL Server Business Intelligence Development Studio<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"SQL_BIDS\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/01_SQL_BIDS.jpg\" width=\"79\" height=\"108\" \/><\/p>\n<p>Select File-&gt; Open -&gt; Analysis Services Database.&#160; When the splash screen renders, select the correct database.&#160; If a database is not listed, enter the correct server and database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BIDS_Open\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/02_BIDS_Open.jpg\" width=\"429\" height=\"338\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Pick_DB\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/03_Pick_DB.jpg\" width=\"473\" height=\"244\" \/><\/p>\n<p> On the right side of the pane in the Solution Explorer Pane, select the desired cube, right click, and select Browse.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"App_Browse\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/04_App_Browse.jpg\" width=\"304\" height=\"280\" \/><\/p>\n<p>Click on the Calculations Tab and in the script Organizer, right click and select New Calculated Member.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Calculations\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/05_BIDS_Calc.jpg\" width=\"332\" height=\"311\" \/><\/p>\n<p> Fill out the Name and the Expression as specified below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Measure\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/06_Measure.jpg\" width=\"559\" height=\"195\" \/><\/p>\n<p>To save the formula, click on the Process button, three green arrows in a circle or from the menu   <br \/>(Build -&gt; Process)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BIDS_Process\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/07_BIDS_Process.jpg\" width=\"53\" height=\"39\" \/><\/p>\n<p>Click Run.<\/p>\n<p>When the process is finished, click Close and Close again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BIDS_Process\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/08_BIDS_Process_Complete.jpg\" width=\"493\" height=\"292\" \/><\/p>\n<p>Navigate back to the Browser Tab and reconnect to the database by clicking on the&#160; <img loading=\"lazy\" decoding=\"async\" alt=\"Reconnect\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/09_BIDS_Reconnect.jpg\" width=\"29\" height=\"31\" \/> icon.<\/p>\n<p>Drag the Measures dimension into the center of the table, Time along rows, and Account for the columns.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Pivot\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/10_BIDS_Pivot.jpg\" width=\"420\" height=\"294\" \/><\/p>\n<p>You will notice that the YTD and the new Rolling 12 measure should equal for the current year, but will be different once you span multiple years.<\/p>\n<p> In order to get this into BPC, you must log into SQL Server Management Studio:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"SQL_MGMT_Studio\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/11_SQL_MGMT_Studio.jpg\" width=\"89\" height=\"96\" \/><\/p>\n<p>Navigate to the proper Application Set -&gt; Tables -&gt; dbo.MeasureFormula.&#160; Right click and choose Edit Top 200 Rows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"SQL_Tables\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/12_SQL_Tables.jpg\" width=\"368\" height=\"181\" \/><\/p>\n<p>Fill out the table according to the below:<\/p>\n<ul>\n<li>&#160;&#160;&#160;&#160; SEQ: Pick a number greater than what is already stored by 10, in my     <br \/>&#160;&#160;&#160;&#160; instance I chose 270 <\/li>\n<li>&#160;&#160;&#160;&#160; Name: The name of the Custom Measure, in this case it is Rolling_12 <\/li>\n<li>&#160;&#160;&#160;&#160; Statement: enter<\/li>\n<\/ul>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [Measures].[Rolling_12] as &#8216;iif([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ACCOUNTDIM%].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;INC&quot; or [%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ACCOUNTDIM%].CurrentMember.Properties(&quot;ACCType&quot;)=&quot;EXP&quot;,sum<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (closingperiod([%TIMEDIM%].month,[%TIMEDIM%].currentmember).lag<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (11):closingperiod([%TIMEDIM%].month,[%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TIMEDIM%].currentmember),Measures.[Periodic]),Measures.[Periodic])<\/p>\n<ul>\n<li>&#160;&#160;&#160;&#160; SolveOrder: 4 <\/li>\n<li>&#160;&#160;&#160;&#160; Description: Rolling_12 <\/li>\n<li>&#160;&#160;&#160;&#160; Required Level: Year <\/li>\n<li>&#160;&#160;&#160;&#160; IsVisible: 1 <\/li>\n<li>&#160;&#160;&#160;&#160; IsYTDApp: 1 for yes or 0 for Periodic <\/li>\n<li>&#160;&#160;&#160;&#160; IsSystem: 1<\/li>\n<\/ul>\n<p>Tab out of the last column to save the row.&#160; Right click on dbo.MeasureFormulaApp and Edit the Top 200 Rows.&#160; Scroll to the bottom and enter the below:<\/p>\n<ul>\n<li>&#160;&#160;&#160;&#160; Application Name: Finance or your cube name <\/li>\n<li>&#160;&#160;&#160;&#160; SEQ: 270, or the number you specified earlier <\/li>\n<li>&#160;&#160;&#160;&#160; Name: Rolling_12 <\/li>\n<li>&#160;&#160;&#160;&#160; Description: Rolling 12<\/li>\n<\/ul>\n<p>The last step is to log into BPC Admin and reprocess the cube.&#160; To do this, login to BPC Administration, go to the applications, and highlight Application.&#160; On the right, click Modify Application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BPC_Modify\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/13_BPC_Modify_App.jpg\" width=\"184\" height=\"227\" \/><\/p>\n<p>Select the appropriate application and check the boxes to Reassign SQL Index and Process Application.&#160; Next, click Modify Application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BPC_Modify_2\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/14_BPC_Modify_App_2.jpg\" width=\"194\" height=\"322\" \/><\/p>\n<p>When this is complete, log into BPC for Excel and in the Measures dimension, you should now see Rolling_12.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BPC_MS_Final\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/15_BPC_MS_Done.jpg\" width=\"323\" height=\"224\" \/><\/p>\n<p><strong>For BPC 7.x, version for Netweaver<\/strong><\/p>\n<p>Login to the SAP GUI and go to transaction SE38.&#160; For the Program, enter UJA_MAINTAIN_MEASURE_FORMULA and click the Execute icon (3<sup>rd<\/sup> from the left)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"SE38\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/16_SE38.jpg\" width=\"492\" height=\"288\" \/><\/p>\n<p>Enter the Application Set ID, Application ID, and the User ID:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Appset_Parameters\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/17_AppSet_App_ID.jpg\" width=\"394\" height=\"152\" \/><\/p>\n<p>Click the green check mark.<\/p>\n<p>Click on the first icon to create a new measure.&#160; Enter Formula Name, Description, and formula.<\/p>\n<p>For Periodic applications, the formula is as follows:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MEMBER [MEASURES].[ROLLING12] AS &#8216;IIF([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;INC&quot;,SUM<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (LastPeriods(12,CLOSINGPERIOD([%TIME%].[LEVEL02])),-[Measures].<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [\/CPMB\/SDATA]),IIF([%P_ACCT%].CURRENTMEMBER.PROPERTIES<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;EXP&quot;,SUM(LastPeriods(12,CLOSINGPERIOD([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TIME%].[LEVEL02])),[Measures].[\/CPMB\/SDATA]),IIF([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;AST&quot;,<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ([MEASURES].[\/CPMB\/SDATA],CLOSINGPERIOD([%TIME%].[LEVEL02])),IIF<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ([%P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;LEQ&quot;,-<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ([MEASURES].[\/CPMB\/SDATA],CLOSINGPERIOD([%TIME%].[LEVEL02])),-<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [MEASURES].[\/CPMB\/SDATA]))))&#8217;;SOLVE_ORDER=3<\/p>\n<p>For YTD applications, the formula is as follows:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MEMBER [MEASURES].[YTD] AS &#8216;IIF(([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;INC&quot; OR<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [%P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;LEQ&quot;),-<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ([MEASURES].[\/CPMB\/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ([MEASURES].[\/CPMB\/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])))&#8217;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOLVE_ORDER=3##MEMBER [MEASURES].[PERIODIC] AS &#8216;IIF(([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;INC&quot; OR<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [%P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;EXP&quot;)<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AND NOT ([%TIME%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/PERIOD&quot;)<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&quot;TOTAL&quot; OR&#160; [%TIME%].CURRENTMEMBER.PROPERTIES<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;2\/CPMB\/PERIOD&quot;)=&quot;Q1&quot;&#160; OR [%TIME%].CURRENTMEMBER.PROPERTIES<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;2\/CPMB\/PERIOD&quot;)=&quot;JAN&quot; ), [MEASURES].[YTD]-([MEASURES].[YTD],[%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TIME%].LAG(1)), [MEASURES].[YTD])&#8217; SOLVE_ORDER=3##MEMBER<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [MEASURES].[ROLLING12_YTD] AS &#8216;IIF([%<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)=&quot;INC&quot; OR<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [%P_ACCT%].CURRENTMEMBER.PROPERTIES(&quot;2\/CPMB\/ACCTYPE&quot;)<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&quot;EXP&quot;,SUM(LASTPERIODS(12,CLOSINGPERIOD([%TIME%].[LEVEL02])),<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [MEASURES].[PERIODIC]),[MEASURES].[PERIODIC])&#8217;;SOLVE_ORDER=3<\/p>\n<p><strong>***Note<\/strong>&#8211; The Rolling 12 custom measure for a YTD application is<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; more complex because it has to build off the Periodic calculation<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; which is built off the YTD calculation.<\/p>\n<p>Click the Save Icon.<\/p>\n<p>Login to BPC for Excel, and you should be able to see the new custom measure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"BPC_NW_Final\" src=\"https:\/\/weblogs.sdn.sap.com\/weblogs\/images\/251984290\/18_BPC_NW_Done.jpg\" width=\"374\" height=\"267\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is not out of the ordinary for a client to want a summation of last 12 months for many accounts.&#160; One way of doing this, if the number of accounts is minimal, is to create several dimension formulas, but &hellip; <a href=\"https:\/\/www.sapbpc.sapag.co.in\/?p=68\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-sap-bpc-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68"}],"version-history":[{"count":0,"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sapbpc.sapag.co.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}