<?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 Need help with a calculated measure in SAS Web Report Studio</title>
    <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31882#M535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies! Actually we might have solved it already, I just forgot to update this post :smileyblush:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A colleague of mine had some spare time so he sat down with this problem, and after some trial and error he came up with a working solution. When he specified the measure over all dimensions but the time dimension (if that makes any sense, I don’t know how to express it) as denominator, the result was the total Quantity for any given month regardless of what drilldowns had been made in the other dimensions.&lt;BR /&gt;So for my example above the MDX for calculating the ratio would look like this (it probably says more than my attempt at an explanation):&lt;BR /&gt;[MEASURES].[Quantity] / ([MEASURES].[Quantity],[Geography].[All Geography],[Gender].[All Gender])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In short, just line up all dimensions in the cube apart from the time dimension in the denominator:&lt;BR /&gt; [MEASURES].[&lt;EM&gt;measure&lt;/EM&gt;] / ([MEASURES].[&lt;EM&gt;measure&lt;/EM&gt;],[&lt;EM&gt;Dimension-1&lt;/EM&gt;].[&lt;EM&gt;All Dimension-1&lt;/EM&gt;],[&lt;EM&gt;Dimension-2&lt;/EM&gt;].[&lt;EM&gt;All Dimension-2&lt;/EM&gt;],[&lt;EM&gt;Dimension-3&lt;/EM&gt;].[&lt;EM&gt;All Dimension-3&lt;/EM&gt;], … ,[&lt;EM&gt;Dimension-n&lt;/EM&gt;].[&lt;EM&gt;All Dimension-n&lt;/EM&gt;])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2011 14:48:42 GMT</pubDate>
    <dc:creator>UlfB</dc:creator>
    <dc:date>2011-12-07T14:48:42Z</dc:date>
    <item>
      <title>Need help with a calculated measure</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31879#M532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’ve been trying to create a calculated measure in Cube Studio for calculating a ratio, but I’m stuck and could use some assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the following:&lt;BR /&gt;As an example let’s say we have a cube with three dimensions, Time, Geography and Gender, and one measure, Quantity. The Time dimension only has one level, month, in the format YYYY-MM. What I would like to have is a new measure that calculates the ratio per month.&lt;BR /&gt;If I create a report in WRS based on the cube and set a group break on the Time dimension, it would look something like this if I for instance select month 2011-09 (where the total for Quantity is 12):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="1" cellspacing="0" class="jiveBorder" style="width: 50%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Geography&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Gender&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Quantity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Ratio&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Africa&lt;/TD&gt;&lt;TD&gt;Female&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;16,7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Africa&lt;/TD&gt;&lt;TD&gt;Male&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;16,7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;Female&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;16,7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;Male&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;8,2%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;Female&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;16,7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;Male&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;25%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somehow I want to use the grand total of Qantity for whatever month I’m currently looking at as denominator in the calculation so that the formula will be 'Value in current cell' / 'Grand total for current month', but I can’t figure out how to accomplish that.&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Ulf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 11:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31879#M532</guid>
      <dc:creator>UlfB</dc:creator>
      <dc:date>2011-10-20T11:42:17Z</dc:date>
    </item>
    <item>
      <title>Need help with a calculated measure</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31880#M533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect you are going to have to use the MDX code (if you are not already).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read more here: &lt;A href="http://support.sas.com/documentation/cdl/en/mdxag/59575/HTML/default/viewer.htm#a002253381.htm"&gt;http://support.sas.com/documentation/cdl/en/mdxag/59575/HTML/default/viewer.htm#a002253381.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Tricia A&lt;/P&gt;&lt;P&gt;Blog: &lt;A href="http://www.bi-notes.com"&gt;BI for SAS BI Users&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2011 11:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31880#M533</guid>
      <dc:creator>TriciaA</dc:creator>
      <dc:date>2011-11-15T11:41:00Z</dc:date>
    </item>
    <item>
      <title>Need help with a calculated measure</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31881#M534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Ulf:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the bloggers on my site published this information recently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.bi-notes.com/2011/12/sas-bi-sas-olap-cube-percent-mdx-calculation/"&gt;Percent of Total MDX Calculation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tricia&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.bi-notes.com"&gt;SAS BI Notes Blog&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31881#M534</guid>
      <dc:creator>TriciaA</dc:creator>
      <dc:date>2011-12-06T15:27:08Z</dc:date>
    </item>
    <item>
      <title>Need help with a calculated measure</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31882#M535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies! Actually we might have solved it already, I just forgot to update this post :smileyblush:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A colleague of mine had some spare time so he sat down with this problem, and after some trial and error he came up with a working solution. When he specified the measure over all dimensions but the time dimension (if that makes any sense, I don’t know how to express it) as denominator, the result was the total Quantity for any given month regardless of what drilldowns had been made in the other dimensions.&lt;BR /&gt;So for my example above the MDX for calculating the ratio would look like this (it probably says more than my attempt at an explanation):&lt;BR /&gt;[MEASURES].[Quantity] / ([MEASURES].[Quantity],[Geography].[All Geography],[Gender].[All Gender])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In short, just line up all dimensions in the cube apart from the time dimension in the denominator:&lt;BR /&gt; [MEASURES].[&lt;EM&gt;measure&lt;/EM&gt;] / ([MEASURES].[&lt;EM&gt;measure&lt;/EM&gt;],[&lt;EM&gt;Dimension-1&lt;/EM&gt;].[&lt;EM&gt;All Dimension-1&lt;/EM&gt;],[&lt;EM&gt;Dimension-2&lt;/EM&gt;].[&lt;EM&gt;All Dimension-2&lt;/EM&gt;],[&lt;EM&gt;Dimension-3&lt;/EM&gt;].[&lt;EM&gt;All Dimension-3&lt;/EM&gt;], … ,[&lt;EM&gt;Dimension-n&lt;/EM&gt;].[&lt;EM&gt;All Dimension-n&lt;/EM&gt;])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 14:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/Need-help-with-a-calculated-measure/m-p/31882#M535</guid>
      <dc:creator>UlfB</dc:creator>
      <dc:date>2011-12-07T14:48:42Z</dc:date>
    </item>
  </channel>
</rss>

