<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures in SAS Web Report Studio</title>
    <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24614#M358</link>
    <description>I would like to use PROC OLAP to create a calculated measure so that when I re-create the cube it is there and ready to go. It is a simple ratio of 2 other sum measures that I am calculating already. I tried using the DEFINE statement, but got the following error message...&lt;BR /&gt;
&lt;BR /&gt;
ERROR: None of the global definitions in the DEFINE statement(s) could be verified as syntactically correct, or none of the global &lt;BR /&gt;
definitions could be registered with the metadata server. &lt;BR /&gt;
&lt;BR /&gt;
Maybe I need to try a different approach?</description>
    <pubDate>Wed, 19 May 2010 15:36:36 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-05-19T15:36:36Z</dc:date>
    <item>
      <title>Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24614#M358</link>
      <description>I would like to use PROC OLAP to create a calculated measure so that when I re-create the cube it is there and ready to go. It is a simple ratio of 2 other sum measures that I am calculating already. I tried using the DEFINE statement, but got the following error message...&lt;BR /&gt;
&lt;BR /&gt;
ERROR: None of the global definitions in the DEFINE statement(s) could be verified as syntactically correct, or none of the global &lt;BR /&gt;
definitions could be registered with the metadata server. &lt;BR /&gt;
&lt;BR /&gt;
Maybe I need to try a different approach?</description>
      <pubDate>Wed, 19 May 2010 15:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24614#M358</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-19T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24615#M359</link>
      <description>The DEFINE statement should work. Can you post an example of your current syntax for us to review?&lt;BR /&gt;
&lt;BR /&gt;
Here is an example of another ratio (built off of a prior DEFINE sum):&lt;BR /&gt;
&lt;BR /&gt;
	DEFINE MEMBER '[CUBE_NAME].[Measures].[Total_Measure_Name]' AS&lt;BR /&gt;
                  'sum(YTD([DIM_NAME].[HIER_NAME].LastChild),[Measures].[Measure_Name]),format_string="DOLLAR20."'&lt;BR /&gt;
	;&lt;BR /&gt;
	&lt;BR /&gt;
	DEFINE MEMBER '[CUBE_NAME].[Measures].[Ratio_Measure_Name]' AS&lt;BR /&gt;
	                  '[Measures].[Total_Measure_Name] / [Measures].[Denominator_Measure_Name],format_string="PERCENT10.2"'&lt;BR /&gt;
		;	&lt;BR /&gt;
&lt;BR /&gt;
~ Angela Hall&lt;BR /&gt;
&lt;A href="http://sas-bi.blogspot.com" target="_blank"&gt;http://sas-bi.blogspot.com&lt;/A&gt;</description>
      <pubDate>Wed, 19 May 2010 16:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24615#M359</guid>
      <dc:creator>AngelaHall</dc:creator>
      <dc:date>2010-05-19T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24616#M360</link>
      <description>Here is the DEFINE statement I used:&lt;BR /&gt;
&lt;BR /&gt;
define member '[SMB_TOTMKT].[Measures].[mkt_share]'&lt;BR /&gt;
as '[Measures].[locations]/[Measures].[vendor_nums]';&lt;BR /&gt;
&lt;BR /&gt;
This looks similar to your 2nd example, only without the format string.</description>
      <pubDate>Wed, 19 May 2010 16:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24616#M360</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-19T16:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24617#M361</link>
      <description>When you run the proc olap full code - do you have a prior step to delete the entire OLAP cube - or just the delete_physical?&lt;BR /&gt;
(it needs to be 'delete' since you are adding metadata)&lt;BR /&gt;
Use my post: &lt;A href="http://sas-bi.blogspot.com/2005/08/refreshing-olap-cubes.html" target="_blank"&gt;http://sas-bi.blogspot.com/2005/08/refreshing-olap-cubes.html&lt;/A&gt; as an example (just change 'delete_physical' to 'delete').&lt;BR /&gt;
&lt;BR /&gt;
Does the user that is running the proc OLAP step have 'write metadata' and 'delete' access to the OLAP schema?&lt;BR /&gt;
&lt;BR /&gt;
~ Angela Hall&lt;BR /&gt;
&lt;A href="http://sas-bi.blogspot.com" target="_blank"&gt;http://sas-bi.blogspot.com&lt;/A&gt;</description>
      <pubDate>Wed, 19 May 2010 16:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24617#M361</guid>
      <dc:creator>AngelaHall</dc:creator>
      <dc:date>2010-05-19T16:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Use PROC OLAP to Calculate a New Measure based on ratio of 2 SUM Measures</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24618#M362</link>
      <description>Yes I have a step to delete the cube prior to running PROC OLAP to create the new cube. This delete step is done using a macro call, delete_cube_reg(CubeName) which in turn executes PROC OLAP cube=&amp;amp;CubeName DELETE;&lt;BR /&gt;
&lt;BR /&gt;
The userid I am using is a common one that I believe has all of the necessary access priveleges since I am able to create and delete cubes using this userid.</description>
      <pubDate>Fri, 21 May 2010 22:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Use-PROC-OLAP-to-Calculate-a-New-Measure-based-on-ratio-of-2-SUM/m-p/24618#M362</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-21T22:38:00Z</dc:date>
    </item>
  </channel>
</rss>

