<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Paul van der Eerden's Brain Dump</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/paul_van_der_eerden/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/paul_van_der_eerden/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:51:48 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Parameter Tips and Tricks (Volume 2)</title>
      <link>https://docs.microsoft.com/archive/blogs/paul_van_der_eerden/parameter-tips-and-tricks-volume-2</link>
      <pubDate>Tue, 12 May 2009 15:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Paul van der Eerden]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/paul_van_der_eerden/2009/05/12/parameter-tips-and-tricks-volume-2/</guid>
      <description><![CDATA[Multi-value Parameters and Null
The Problem
One of the questions I hear most often is (and I have...]]></description>
      <content:encoded><![CDATA[<H2 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=4>Multi-value Parameters and Null</FONT></H2>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=3>The Problem</FONT></H3>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>One of the questions I hear most often is (and I have asked it myself a few times) is, “Why can I not have a multi-value parameter that also allows NULL?”</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>It is a good question, and one that does not have a simple answer.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The easiest way to justify this restriction is that the meaning of such a parameter is unclear.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If you consider a SQL query that makes use of a multi value parameter, it might look like this:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT * FROM MyTable WHERE MyField IN (@MyParam)</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Passing non-null values in here works quite well by substituting @MyParam with a comma separated list of values.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Expanded, that might look like this:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT * FROM MyTable WHERE MyField IN (‘Value1’,’Value2’)</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>You might think that passing null in here would work, but unfortunately you would be wrong.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The first issue is how to translate NULL from something Reporting Services (RS) understands to something the database understands.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Is NULL in RS equivalent to System.DbNull, an empty string, or something else?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Does it need quotation marks around it?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The second problem is that even if we find the right translation, we are still not out of the woods.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This query does not do what you likely want:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT * FROM MyTable WHERE MyField IN (‘Value1’,NULL)<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN></FONT><SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">ß</SPAN></SPAN><FONT face=Calibri> Not going to work</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>So where does that leave us?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To return the values from a table where a field is null, we need to use the IS operator with NULL :</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>SELECT * FROM MyTable WHERE MyField IS NULL</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Of course now we have lost the rest of our filter.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Combining the two does not work:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>SELECT * FROM MyTable WHERE MyField IN (@MyParam) OR MyField IS NULL</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>This would always return the filtered values AND the records where MyField is NULL.</FONT></P>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=3>One Solution</FONT></H3>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>The following trick takes a bit of setting up, but it works quite well.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The first thing you want to do is create a query where we can compare apples to apples.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>In other words, we want stop treating NULL differently than any other value.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>One way you can do this is to force NULL into a string:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>SELECT * FROM MyTable WHERE </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>CASE <SPAN style="mso-spacerun: yes">&nbsp;</SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: 0.5in"><FONT size=3><FONT face=Calibri>WHEN Customers.Region IS NULL THEN 'NULL'<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>ELSE Customers.Region<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>END IN (@Region)</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Now we need to pass NULL in to this query as a string.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Let us assume we have a multi-value report parameter whose available values come from another query:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT DISTINCT MyField FROM MyTable</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>RS is going to do some massaging of this data to remove the NULL values before presenting the available values to the user.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We need to add that back in not as NULL, but as the string ‘NULL’ instead.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We can modify that query to do this:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT DISTINCT MyField FROM MyTable</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>UNION</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SELECT ‘NULL’ AS MyField</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Unfortunately, NULL now appears alphabetized under “N” in your list.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We can tweak this by introducing a sort order in a nested query:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>SELECT * FROM</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>(SELECT DISTINCT<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Customers.Region, 1 AS SortOrder FROM Customers</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>UNION</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: 0.5in"><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>SELECT 'NULL' AS Region, 0 AS SortOrder) WithNull</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"><FONT face=Calibri size=3>ORDER BY SortOrder ASC</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>You can now set the default value of this parameter to ‘NULL’ if you like.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>[Thanks to BB who suggested using ' NULL' (note the space) instead;&nbsp;this causes it to be sorted to the top of the list without the need for the sort order in a nested query.]</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>This sample works for the simple SQL query case, but since there are many flavours of SQL running on a variety of DBMSs and, of course, non-SQL queries it is difficult to cover all cases.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This article is meant as a jumping-off point to get you started down the right path.</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>Parameter Tips and Tricks (Volume 1)</title>
      <link>https://docs.microsoft.com/archive/blogs/paul_van_der_eerden/parameter-tips-and-tricks-volume-1</link>
      <pubDate>Fri, 08 May 2009 17:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Paul van der Eerden]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/paul_van_der_eerden/2009/05/08/parameter-tips-and-tricks-volume-1/</guid>
      <description><![CDATA[It seems clear to me that, from the number of posts on the topic, parameters are a not the easiest...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>It seems clear to me that, from the number of posts on the topic, parameters are a not the easiest report items to work with for many of our customers.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Until some of your suggestions make it into the product, I would like to make it a bit easier for you to use parameters.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To that end, I thought I would share some of the tricks I have learned to make parameters a bit more useful.</FONT></P>
<H2 style="MARGIN: 10pt 0in 0pt"><FONT color=#4f81bd size=4 face=Cambria>Showing the Selected Values in your Report</FONT></H2>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>In order to display the selected values of a parameter in your report, you need to know whether or not the parameter allows multiple values.</FONT></P>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT color=#4f81bd size=3 face=Cambria>Single-value Parameter</FONT></H3>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>If you are using single-value parameters, the solution is trivial: set the expression of the textbox in which you wish to display the value to</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>=Parameters!ParameterName.Value</FONT></P></BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>You can use ‘=Parameters!ParameterName.Label’ to display the label instead.</FONT></P>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT color=#4f81bd size=3 face=Cambria>Multi-value Parameter</FONT></H3>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>If the parameter is a multi-value parameter, then the expression gets a bit more complicated.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Multi-value parameters are represented as arrays and the expressions that use them need to account for that. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Using the above expression on a multi-value parameter would result in an error at view time. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Report Builder is a bit nicer when selecting a multi-value parameter from the values list in the expression builder; it builds an expression that will not result in an error, but it is not particularly useful either: ‘=Parameters!MyParameter.Value(0)’.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This will only give you the first parameter value in the selection. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>The easiest way to change the expression to handle an arbitrary number of selected parameter values is to use the JOIN function, like this:</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>=Join(Parameters!MyParameter.Label, “, “)</FONT></P></BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The first argument to the JOIN function is an array; the array index (0) is not needed (nor expected) in this context.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Using the JOIN function works well unless the user has selected a very large number of parameters (or has chosen the ‘Select All’ option).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This could result in a spectacularly long list which might not be that useful.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>In this case you might want to limit the number of items to show:</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>=iif(Parameters!MyParameter.Count&lt;5, Join(Parameters!MyParameter.Label, “, “), “5 or more!”)</FONT></P></BLOCKQUOTE>
<H4 style="MARGIN: 10pt 0in 0pt"><EM><FONT color=#4f81bd face=Cambria>Select All: Special Case</FONT></EM></H4>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Suppose that you want to show the entire list of selected parameter values, unless the user has selected all the values, in which case you want to display ‘All’.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This requires a bit of a trick.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>First: the chicken or the egg?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>There is no way to get the count of all the possible parameter values in a parameters list at view time unless the user selects them all, but that does not help because, without knowing what that total is, we cannot tell that the user has selected them all.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The trick: hide a parameter that tells us the total!<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Suppose you have a dataset that drives the available values of your parameter:</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>SELECT id, name FROM people</FONT></P></BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>You can create a new dataset (CountValues) that counts the values that your existing parameter will use:</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>SELECT COUNT(id) AS ValCount FROM people</FONT></P></BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Now create a new parameter (MyCountParameter) with these properties:<BR>Data Type: Integer<BR>Allow Null: False<BR>Allow Multiple Values: False<BR>Parameter Visibility: Hidden<BR>Available Values: None<BR>Default Values:<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>From Query “CountValues” (Value field: ValCount)</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Finally, set this as the expression on an appropriate&nbsp;textbox in your report:</FONT></P>
<BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>=iif(Parameters!MyParameter.Count&lt;Parameters!MyCountParameter.Value,Join(Parameters!MyParameter.Label,","),"All")</FONT></P></BLOCKQUOTE>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>More to come later.</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>Parameterizing an MDX Query with a Report Parameter Value in Report Builder 2.0</title>
      <link>https://docs.microsoft.com/archive/blogs/paul_van_der_eerden/parameterizing-an-mdx-query-with-a-report-parameter-value-in-report-builder-2-0</link>
      <pubDate>Tue, 17 Mar 2009 16:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Paul van der Eerden]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/paul_van_der_eerden/2009/03/17/parameterizing-an-mdx-query-with-a-report-parameter-value-in-report-builder-2-0/</guid>
      <description><![CDATA[While&nbsp;attempting to answer a forum post the other day, I discovered that creating a report...]]></description>
      <content:encoded><![CDATA[<P>While&nbsp;attempting to answer a forum post the other day, I discovered that creating a report against Analysis Services (AS) was not as easy as I had expected it to be.&nbsp; Simple reports using basic MDX are easy enough; the query designer does most of the work for you.&nbsp; But what if I want to create a report that contains a parameter with a set of available values that come from my data and&nbsp;uses the selected value in an MDX query to retrieve the data I want to display?&nbsp; </P>
<P>In the SQL Server case, the queries are simpler, and the query designer even helps me by recognizing query parameters in the query command text and prompting for values.&nbsp; In the AS case, queries can get pretty complex and query parameters can be anything: scalar values, strings that represent members, strings that represent sets, strings to be used in any number of MDX functions.&nbsp; This means that there is no easy way for the query designer to determine what to prompt for... so it doesn't prompt for any value, it simply tells you that your parameter is undefined.&nbsp; Not super helpful.</P>
<P>Until we add a complete MDX parser to the tool to help get past some of the difficulties metioned above, here is a sample of how you can get started:</P>
<P><STRONG>First:<BR></STRONG>You'll want to create a dataset&nbsp;called OrganizationsQuery that you can use to&nbsp;use for your report parameter's available values (this is something you won't want to hard code since unique names in AS can be long and ugly).&nbsp; Your dataset's query might look something like this:</P>
<BLOCKQUOTE>
<P>WITH <BR>&nbsp; MEMBER OrgUniqueName as [Organization].[Organizations].CurrentMember.UniqueName<BR>SELECT <BR>&nbsp; NON EMPTY { [Measures].[OrgUniqueName] } ON COLUMNS, <BR>&nbsp; NON EMPTY { (DESCENDANTS([Organization].[Organizations].[Organization Level 01].ALLMEMBERS) ) } <BR>&nbsp;&nbsp;&nbsp; DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS <BR>FROM [Adventure Works]</P></BLOCKQUOTE>
<P>This will give you results that look like this:<BR><U>Organizations</U>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <U>OrgUniqueName</U><BR>AdventureWorks Cycle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Organization].[Organizations].&amp;[1]<BR>European Operations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Organization].[Organizations].&amp;[9]<BR>France&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Organization].[Organizations].&amp;[11]<BR>Germany&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Organization].[Organizations].&amp;[12]<BR>etc...</P>
<P><EM>Note: To&nbsp;build this query you will have to modify MDX directly.&nbsp; Use the right-most toolbar button to change to&nbsp;MDX editing mode.</EM></P>
<P><STRONG>Second:<BR></STRONG>Create a&nbsp;report parameter called @OrganizationsRP<BR>-Set the Available Values to use the OrganizationsQuery dataset<BR>&nbsp; -Set the Value to OrgUniqueName<BR>&nbsp; -Set the Label to Organizations</P>
<P><STRONG>Third:</STRONG><BR>Create a dataset called (FinancialAmountBySelectedOrganization):</P>
<BLOCKQUOTE>
<P>SELECT <BR>&nbsp; NON EMPTY { [Measures].[Amount] } ON COLUMNS, <BR>&nbsp; NON EMPTY { strtoset(@OrganizationQP) } <BR>&nbsp;&nbsp;&nbsp; DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, LEVEL_NUMBER ON ROWS <BR>FROM [Adventure Works] <BR>&nbsp; CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS</P></BLOCKQUOTE>
<P><EM>Note: To&nbsp;build this query you will have to modify MDX directly.&nbsp; Use the right-most toolbar button to change to&nbsp;MDX editing mode.</EM></P>
<P>Executing this query from inside the query designer will not work yet; the query designer does not know what to use for @OrganizationQP.&nbsp; To fix this, click on the button that has the <A href="mailto:'@'" mce_href="mailto:'@'">'@'</A> symbol on it.&nbsp; Create a new query parameter called OrganizationQP (note that it should match the name used in your query, but without the @), and give it an appropriate dimension, hierarchy and default value(s).&nbsp; MDX query parameters need default values because the query needs to be executed in order to retrieve the schema (field names, etc.)</P>
<P><STRONG>Finally:<BR></STRONG>Make sure that your dataset properties map the query parameter (OrganizationQP) to the report parameter [@OrganizationRP].</P>
<P>You should now be able to drop a table on to your report canvas, throw some fields from your FinancialAmountBySelectedOrganization dataset into it, and run the report.&nbsp; The table will only display results that match the parameters you select at view time.</P>]]></content:encoded>
    </item>
  </channel>
</rss>