<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The InScope() Function and the key to formatting subtotals in SSRS Matrix Objects</title>
	<atom:link href="http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/</link>
	<description>A blog about Integration services, Reporting services, and the things that interest me</description>
	<lastBuildDate>Tue, 27 Jul 2010 15:45:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: SSRS InScope() function: The key to format your matrix! &#171; Clint Huijbers&#39;s Blog</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-922</link>
		<dc:creator>SSRS InScope() function: The key to format your matrix! &#171; Clint Huijbers&#39;s Blog</dc:creator>
		<pubDate>Fri, 16 Jul 2010 09:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-922</guid>
		<description>[...] to Luke Hayler for his great [...]</description>
		<content:encoded><![CDATA[<p>[...] to Luke Hayler for his great [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke Hayler</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-519</link>
		<dc:creator>Luke Hayler</dc:creator>
		<pubDate>Fri, 07 May 2010 20:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-519</guid>
		<description>Bill,

Ruth has kindly added a link (further down this comment stream) that may be relevant to your issue. Here it is again: 
&lt;a href=&quot;http://support.microsoft.com/kb/945910&quot; rel=&quot;nofollow&quot;&gt;http://support.microsoft.com/kb/945910&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>Ruth has kindly added a link (further down this comment stream) that may be relevant to your issue. Here it is again:<br />
<a href="http://support.microsoft.com/kb/945910" rel="nofollow">http://support.microsoft.com/kb/945910</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruth</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-517</link>
		<dc:creator>Ruth</dc:creator>
		<pubDate>Fri, 07 May 2010 17:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-517</guid>
		<description>Hi,
This is in reference to Bill&#039;s comment on May 7.  I haven&#039;t been able to get all the conditional color formatting to work in my VS2005.  This week I found this article but haven&#039;t applied the update yet: http://support.microsoft.com/kb/945910</description>
		<content:encoded><![CDATA[<p>Hi,<br />
This is in reference to Bill&#8217;s comment on May 7.  I haven&#8217;t been able to get all the conditional color formatting to work in my VS2005.  This week I found this article but haven&#8217;t applied the update yet: <a href="http://support.microsoft.com/kb/945910" rel="nofollow">http://support.microsoft.com/kb/945910</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-516</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 07 May 2010 17:15:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-516</guid>
		<description>Did you ever get this sorted? I&#039;m having the same issue where the conditional color formatting works when its in VS and even when I export it to PDF from the server, but when the server displays the report, the conditional formatting is gone.

(Looking in the XML) It seems that the server is using the Style element on the subtotal textbox element instead of the conditional formatting that I specified. I&#039;d move the logic there, but I can&#039;t get the same scoping to properly condition on my data.</description>
		<content:encoded><![CDATA[<p>Did you ever get this sorted? I&#8217;m having the same issue where the conditional color formatting works when its in VS and even when I export it to PDF from the server, but when the server displays the report, the conditional formatting is gone.</p>
<p>(Looking in the XML) It seems that the server is using the Style element on the subtotal textbox element instead of the conditional formatting that I specified. I&#8217;d move the logic there, but I can&#8217;t get the same scoping to properly condition on my data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruth</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-473</link>
		<dc:creator>Ruth</dc:creator>
		<pubDate>Thu, 01 Apr 2010 14:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-473</guid>
		<description>Hi Luke,
Thank you for your response.
When I use your expression in my report, I don&#039;t get any dark gray cells. It seems that once you are outside the column group there are no cells where InScope(&quot;matrix1_RowGroup_Inner&quot;) is true.</description>
		<content:encoded><![CDATA[<p>Hi Luke,<br />
Thank you for your response.<br />
When I use your expression in my report, I don&#8217;t get any dark gray cells. It seems that once you are outside the column group there are no cells where InScope(&#8220;matrix1_RowGroup_Inner&#8221;) is true.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke Hayler</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-472</link>
		<dc:creator>Luke Hayler</dc:creator>
		<pubDate>Wed, 31 Mar 2010 21:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-472</guid>
		<description>Hi Ruth,

Identifying the correct &#039;scope&#039; for a matrix with one column group and two row groups is tricky. What you have to remember is that there is an &#039;in&#039; and &#039;out&#039; of scope for each cell. Sometimes you will have to repeat a piece of code in several places to get the required effect. 

The following code will identify all possible scoped cells:

=IIF(InScope(&quot;matrix1_ColumnGroup&quot;),
IIF(InScope(&quot;matrix1_RowGroup_Inner&quot;),&quot;Blue&quot;,
IIF(InScope(&quot;matrix1_RowGroup_Outer&quot;),&quot;Red&quot;,&quot;Mistyrose&quot;)), 
IIF(InScope(&quot;matrix1_RowGroup_Inner&quot;),&quot;DarkGray&quot;,
IIF(InScope(&quot;matrix1_RowGroup_Outer&quot;),&quot;Yellow&quot;,&quot;Lime&quot;)))

I have used hideous colours so as to ensure that you can identify each cell correctly. 

Hope it helps!</description>
		<content:encoded><![CDATA[<p>Hi Ruth,</p>
<p>Identifying the correct &#8217;scope&#8217; for a matrix with one column group and two row groups is tricky. What you have to remember is that there is an &#8216;in&#8217; and &#8216;out&#8217; of scope for each cell. Sometimes you will have to repeat a piece of code in several places to get the required effect. </p>
<p>The following code will identify all possible scoped cells:</p>
<p>=IIF(InScope(&#8220;matrix1_ColumnGroup&#8221;),<br />
IIF(InScope(&#8220;matrix1_RowGroup_Inner&#8221;),&#8221;Blue&#8221;,<br />
IIF(InScope(&#8220;matrix1_RowGroup_Outer&#8221;),&#8221;Red&#8221;,&#8221;Mistyrose&#8221;)),<br />
IIF(InScope(&#8220;matrix1_RowGroup_Inner&#8221;),&#8221;DarkGray&#8221;,<br />
IIF(InScope(&#8220;matrix1_RowGroup_Outer&#8221;),&#8221;Yellow&#8221;,&#8221;Lime&#8221;)))</p>
<p>I have used hideous colours so as to ensure that you can identify each cell correctly. </p>
<p>Hope it helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruth</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-471</link>
		<dc:creator>Ruth</dc:creator>
		<pubDate>Wed, 31 Mar 2010 21:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-471</guid>
		<description>Hi, 
Thanks to everyone for the previous comments, which have been a big help to me. But I still have an annoying problem with one of my matrix reports. 
The matrix has 2 row groups and 1 column group with subtotals for all groups. I am using the &quot;cells in cells&quot; technique to display a &quot;Sum&quot; and a &quot;Count&quot; in each data cell. I need to clear all of the subtotals for the &quot;Sum&quot; cells except for the ones subtotalling across the matrix for the inner row group.
This expression almost gets me there:
=IIf(InScope(&quot;matrix1_ColumnGroup&quot;),
IIf(InScope(&quot;matrix1_RowGroup_Inner&quot;) ,&quot;LightBlue&quot;, &quot;Yellow&quot;),
IIf(InScope(&quot;matrix1_RowGroup_Outer&quot;) ,&quot;LightGreen&quot;,
 &quot;Pink&quot;))
Subtotals to be cleared are yellow and pink (grand total).
But I can&#039;t identify the outer group subtotal in the light green section.
According to what I have read, I should be able to use an expression like &quot;cell IS NOT in inner row group AND cell IS in outer row group&quot; but this doesn&#039;t work. I’m wondering if &quot;cells in cells&quot; is causing this problem. Any ideas will be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks to everyone for the previous comments, which have been a big help to me. But I still have an annoying problem with one of my matrix reports.<br />
The matrix has 2 row groups and 1 column group with subtotals for all groups. I am using the &#8220;cells in cells&#8221; technique to display a &#8220;Sum&#8221; and a &#8220;Count&#8221; in each data cell. I need to clear all of the subtotals for the &#8220;Sum&#8221; cells except for the ones subtotalling across the matrix for the inner row group.<br />
This expression almost gets me there:<br />
=IIf(InScope(&#8220;matrix1_ColumnGroup&#8221;),<br />
IIf(InScope(&#8220;matrix1_RowGroup_Inner&#8221;) ,&#8221;LightBlue&#8221;, &#8220;Yellow&#8221;),<br />
IIf(InScope(&#8220;matrix1_RowGroup_Outer&#8221;) ,&#8221;LightGreen&#8221;,<br />
 &#8220;Pink&#8221;))<br />
Subtotals to be cleared are yellow and pink (grand total).<br />
But I can&#8217;t identify the outer group subtotal in the light green section.<br />
According to what I have read, I should be able to use an expression like &#8220;cell IS NOT in inner row group AND cell IS in outer row group&#8221; but this doesn&#8217;t work. I’m wondering if &#8220;cells in cells&#8221; is causing this problem. Any ideas will be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke Hayler</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-392</link>
		<dc:creator>Luke Hayler</dc:creator>
		<pubDate>Wed, 10 Feb 2010 22:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-392</guid>
		<description>Hi Sandy,

As I have just mentioned to George (previous comments), you need to think of your groups as containers. The outer group &#039;containing&#039; each of the inner groups. Thus, if a cell is within an inner group&#039;s scope, it is by default within the outer group&#039;s scope too. However, and here&#039;s the trick, if the cell is NOT within the inner group&#039;s scope BUT IT IS within the Outer Group&#039;s scope, that&#039;s where you get a subtotal.

So to amend your expression:

&lt;b&gt;&lt;i&gt; Remember: =IIF(InScope(), &#039;true part&#039;, &#039;false part&#039;) &lt;/i&gt;&lt;/b&gt;

=IIF(InScope(&quot;Matrix1_level2&quot;), IIF(InScope(&quot;Matrix1_level1&quot;), &quot;Within Group 1 &amp; 2 Scope&quot;, &quot;Within Group 2 Scope Only (Subtotal)&quot;), &quot;Matrix Scope (or Grand Total)&quot;)

If you are still not clear then perhaps I need to do my first screen cast... ;)</description>
		<content:encoded><![CDATA[<p>Hi Sandy,</p>
<p>As I have just mentioned to George (previous comments), you need to think of your groups as containers. The outer group &#8216;containing&#8217; each of the inner groups. Thus, if a cell is within an inner group&#8217;s scope, it is by default within the outer group&#8217;s scope too. However, and here&#8217;s the trick, if the cell is NOT within the inner group&#8217;s scope BUT IT IS within the Outer Group&#8217;s scope, that&#8217;s where you get a subtotal.</p>
<p>So to amend your expression:</p>
<p><b><i> Remember: =IIF(InScope(), &#8216;true part&#8217;, &#8216;false part&#8217;) </i></b></p>
<p>=IIF(InScope(&#8220;Matrix1_level2&#8243;), IIF(InScope(&#8220;Matrix1_level1&#8243;), &#8220;Within Group 1 &#038; 2 Scope&#8221;, &#8220;Within Group 2 Scope Only (Subtotal)&#8221;), &#8220;Matrix Scope (or Grand Total)&#8221;)</p>
<p>If you are still not clear then perhaps I need to do my first screen cast&#8230; <img src='http://www.lukehayler.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke Hayler</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-391</link>
		<dc:creator>Luke Hayler</dc:creator>
		<pubDate>Wed, 10 Feb 2010 22:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-391</guid>
		<description>Hi George,

If your groups (A, B, C) correspond to (for example) Year&gt;Month&gt;Day, then yes, InScope(YearGroup) means that MonthGroup &amp; DayGroup will also evaluate to true. Why? Because the YearGroup &#039;contains&#039; the Month/Day groups. Make sense?

To distinguish between detail and subtotals (in this instance) you will need to do the following:

Using the Year&gt;Month&gt;Day example set:

=IIF(InScope(YearGrp), 
     IIF(InScope(MonthGrp), 
         IIF(InScope(DayGrp), DetailData, 
                              MonthSubTotal),
                              YearSubTotal),
                              GrandTotal)

In plain english:
If the cell falls within the YearGroup bounds, then:
 if the cell falls within the MonthGroup bounds, then:
  if the cell falls within the DayGroup bounds, then its a detail cell, Else:
  it falls outside of the DayGroup but within the MonthGroup, so its a Month Subtotal, Else:
 it falls outside of the MonthGroup but within the YearGroup, so it&#039;s a Year Subtotal, Else:
it falls outside of the year group, therefore it must be a Grand Total (All Years).

Whew!
  
If you Start from the very outer group and work your way in to the Detail groups then you can (fairly) easily determine the Grand Total &amp; Subtotals - because they fall Out-of-Scope of the group in question.

So, to answer your question. Yes you will get a &#039;True&#039; for Group B/C (for your current query). To fix that you need to specify, for each of Group B &amp; C, the &#039;False&#039; criteria (i.e. what should be shown if not within the bounds of the group in question). 
The example I have given above should help you out in distinguishing between the detail, subtotal &amp; grand total lines.

If you have more questions, please let me know. This is a hot topic!</description>
		<content:encoded><![CDATA[<p>Hi George,</p>
<p>If your groups (A, B, C) correspond to (for example) Year>Month>Day, then yes, InScope(YearGroup) means that MonthGroup &#038; DayGroup will also evaluate to true. Why? Because the YearGroup &#8216;contains&#8217; the Month/Day groups. Make sense?</p>
<p>To distinguish between detail and subtotals (in this instance) you will need to do the following:</p>
<p>Using the Year>Month>Day example set:</p>
<p>=IIF(InScope(YearGrp),<br />
     IIF(InScope(MonthGrp),<br />
         IIF(InScope(DayGrp), DetailData,<br />
                              MonthSubTotal),<br />
                              YearSubTotal),<br />
                              GrandTotal)</p>
<p>In plain english:<br />
If the cell falls within the YearGroup bounds, then:<br />
 if the cell falls within the MonthGroup bounds, then:<br />
  if the cell falls within the DayGroup bounds, then its a detail cell, Else:<br />
  it falls outside of the DayGroup but within the MonthGroup, so its a Month Subtotal, Else:<br />
 it falls outside of the MonthGroup but within the YearGroup, so it&#8217;s a Year Subtotal, Else:<br />
it falls outside of the year group, therefore it must be a Grand Total (All Years).</p>
<p>Whew!</p>
<p>If you Start from the very outer group and work your way in to the Detail groups then you can (fairly) easily determine the Grand Total &#038; Subtotals &#8211; because they fall Out-of-Scope of the group in question.</p>
<p>So, to answer your question. Yes you will get a &#8216;True&#8217; for Group B/C (for your current query). To fix that you need to specify, for each of Group B &#038; C, the &#8216;False&#8217; criteria (i.e. what should be shown if not within the bounds of the group in question).<br />
The example I have given above should help you out in distinguishing between the detail, subtotal &#038; grand total lines.</p>
<p>If you have more questions, please let me know. This is a hot topic!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandy</title>
		<link>http://www.lukehayler.com/2009/07/the-inscope-function-and-the-key-to-formatting-subtotals-in-ssrs-matrix-objects/comment-page-1/#comment-390</link>
		<dc:creator>Sandy</dc:creator>
		<pubDate>Wed, 10 Feb 2010 14:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.lukehayler.com/?p=10#comment-390</guid>
		<description>Hi,

I am new to SSRS matrix report. I am currently facing the following problems:

. I have no column grouping
. I have two rows grouping Matrix1_level1 and Matrix1_level2

I have the following expression inside a cell in a matrix data region.

=iif(inscope(&quot;Matrix1_level2&quot;),
          &quot;Within Group2 Scope&quot;,
          iif(inscope(&quot;Matrix1_level1&quot;),
      &quot;Within Group1 Scope&quot;,
           iif(inscope(&quot;matrix1&quot;),
              &quot;Within Matrix Scope&quot;,
              nothing)))


But this is not working. The result I get is this.
On both group1&#039;s line and group2&#039;s line as &quot;Within Group1 Scope&quot;.
and subtotal
&quot;Within Matrix Scope&quot; message is showing up ok.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am new to SSRS matrix report. I am currently facing the following problems:</p>
<p>. I have no column grouping<br />
. I have two rows grouping Matrix1_level1 and Matrix1_level2</p>
<p>I have the following expression inside a cell in a matrix data region.</p>
<p>=iif(inscope(&#8220;Matrix1_level2&#8243;),<br />
          &#8220;Within Group2 Scope&#8221;,<br />
          iif(inscope(&#8220;Matrix1_level1&#8243;),<br />
      &#8220;Within Group1 Scope&#8221;,<br />
           iif(inscope(&#8220;matrix1&#8243;),<br />
              &#8220;Within Matrix Scope&#8221;,<br />
              nothing)))</p>
<p>But this is not working. The result I get is this.<br />
On both group1&#8217;s line and group2&#8217;s line as &#8220;Within Group1 Scope&#8221;.<br />
and subtotal<br />
&#8220;Within Matrix Scope&#8221; message is showing up ok.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
