<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Miky Schreiber's Blog - BI|SQL Server 2008</title>
    <link>http://www.miky-schreiber.com/Blog/</link>
    <description>Business Intelligence, Analysis Services, MDX, DataWarehousing and more...</description>
    <language>en-us</language>
    <copyright>Miky Schreiber</copyright>
    <lastBuildDate>Thu, 01 Jul 2010 09:31:33 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>miky@zahav.net.il</managingEditor>
    <webMaster>miky@zahav.net.il</webMaster>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=74fd776a-97c3-4148-94dc-b6ccad13b191</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,74fd776a-97c3-4148-94dc-b6ccad13b191.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,74fd776a-97c3-4148-94dc-b6ccad13b191.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=74fd776a-97c3-4148-94dc-b6ccad13b191</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>This is the fifth and last post regarding <a href="http://blogs.microsoft.co.il/blogs/itaybraun/">Itay
Braun</a>'s</em>
          <em> seminar in the SQL &amp; BI conference. In this post, I'll
write some notes I collected from the last part of the seminar which discussed
SSRS. As you can see, most of the tips are relevent for every reporting tool.</em>
        </p>
        <ul>
          <li>
Scale-Out instead of Scale-In. Meaning that it's better to have multiple SSRS servers
on one DB then bigger and better single SSRS server. 
</li>
          <li>
One report should not return all the data. Define and build your report to answer
specific answer. 
</li>
          <li>
Use subscriptions. Minimile impact on performance. 
</li>
          <li>
Use cache executions or at least snapshots. 
</li>
          <li>
Visualization (see also my <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,6e4ca812-5a91-49b9-9b9e-64ef1e978257.aspx">post
about dashboard design</a>) 
<ul><li>
Use same colors for for the same business units 
</li><li>
Use images for better data recognition (e.g countries' flags)</li></ul></li>
          <li>
Monitor the SSRS server. Look at the trace logs, the execution log and the performance
counters. You can use <a href="http://www.summitcloud.com/solutions/scrubs/ssrs-report-catalog.aspx">Scrubs</a>(free
SSRS performance reports).</li>
        </ul>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=74fd776a-97c3-4148-94dc-b6ccad13b191" />
      </body>
      <title>Notes from the SQL &amp; BI conference - Reporting Services</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,74fd776a-97c3-4148-94dc-b6ccad13b191.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,74fd776a-97c3-4148-94dc-b6ccad13b191.aspx</link>
      <pubDate>Thu, 01 Jul 2010 09:31:33 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;This is the&amp;nbsp;fifth and last&amp;nbsp;post&amp;nbsp;regarding &lt;a href="http://blogs.microsoft.co.il/blogs/itaybraun/"&gt;Itay
Braun&lt;/a&gt;'s&lt;/em&gt;&lt;em&gt;&amp;nbsp;seminar in the SQL &amp;amp; BI conference. In this post, I'll
write some notes I collected from the&amp;nbsp;last part of the seminar which discussed
SSRS. As you can see, most of the tips are relevent for every reporting tool.&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Scale-Out instead of Scale-In. Meaning that it's better to have multiple SSRS servers
on one DB then bigger and better single SSRS server. 
&lt;li&gt;
One report should not return all the data. Define and build your report to answer
specific answer. 
&lt;li&gt;
Use subscriptions. Minimile impact on performance. 
&lt;li&gt;
Use cache executions or at least snapshots. 
&lt;li&gt;
Visualization (see also my &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,6e4ca812-5a91-49b9-9b9e-64ef1e978257.aspx"&gt;post
about dashboard design&lt;/a&gt;) 
&lt;ul&gt;
&lt;li&gt;
Use same colors for for the same business units 
&lt;li&gt;
Use images for better data recognition (e.g countries' flags)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Monitor the SSRS server. Look at the trace logs, the execution log and the performance
counters. You can use &lt;a href="http://www.summitcloud.com/solutions/scrubs/ssrs-report-catalog.aspx"&gt;Scrubs&lt;/a&gt;(free
SSRS performance reports).&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=74fd776a-97c3-4148-94dc-b6ccad13b191" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,74fd776a-97c3-4148-94dc-b6ccad13b191.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>This is the fourth post about <a href="http://blogs.microsoft.co.il/blogs/itaybraun/">Itay
Braun</a></em>
          <em>'s seminar in the SQL &amp; BI conference. In this post, I'll write
some notes I collected from the third part of the seminar which discussed SSIS.</em>
        </p>
        <ul>
          <li>
Log everything that happens inside the package. Use the SSIS log providers and the
event handlers. The effect on performance is not significant. 
</li>
          <li>
Analyize the log data. You can analize total execution time, SSAS partition processing
time and much more.</li>
          <li>
Log detailed error information about rejected rows. You can even log the actual error
row.</li>
          <li>
Monitor also the execution of the ETL jobs.</li>
          <li>
Data Profiling is a new feature in SSIS 2008. It's used for analysis of the data's
quality in the DWH. Go and learn.</li>
          <li>
Configure everything you can in the package configuration, such as: tasks, containers,
variables, connection managers and data flow components. You can use XML config
file, config from parent package, registry configuration or even configuration from
a table.</li>
          <li>
The Cache Transformation saves data in the cache. It's very useful in lookups.</li>
          <li>
Data types: Make them as "small" as possible (better performance). Be aware of
precision issues when using money, float and decimal types.</li>
          <li>
Don't sort in SSIS unless it's absolutely necessary.</li>
          <li>
Sometimes using T-SQL will be faster then running it in SSIS.</li>
        </ul>
        <p>
Some of the tips are also relevant in Informatica. For example, I always let the DB
make the sort whenever possible. Sometimes it's also works with joins. Running packages
or procedures can be much more faster than running it in the ETL, but if you look
at it from maintenance point of view you'll do it in the ETL. It depends on much factors,
such as the time you can have to run the ETL, the knowledge in your team and more.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3" />
      </body>
      <title>Notes from the SQL &amp; BI conference - SSIS</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3.aspx</link>
      <pubDate>Tue, 22 Jun 2010 12:40:51 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;This is the&amp;nbsp;fourth post about &lt;a href="http://blogs.microsoft.co.il/blogs/itaybraun/"&gt;Itay
Braun&lt;/a&gt;&lt;/em&gt;&lt;em&gt;'s seminar in the SQL &amp;amp; BI conference. In this post, I'll write
some notes I collected from the third part of the seminar which discussed SSIS.&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Log everything that happens inside the package. Use the SSIS log providers and the
event handlers. The effect on performance is not significant. 
&lt;/li&gt;
&lt;li&gt;
Analyize the log data. You can analize total execution time, SSAS partition processing
time and much more.&lt;/li&gt;
&lt;li&gt;
Log detailed error information about rejected rows. You can even log the actual error
row.&lt;/li&gt;
&lt;li&gt;
Monitor also the execution of the ETL jobs.&lt;/li&gt;
&lt;li&gt;
Data Profiling is a new feature in SSIS 2008. It's used for analysis of the data's
quality in the DWH. Go and learn.&lt;/li&gt;
&lt;li&gt;
Configure everything you can in the package configuration, such as: tasks, containers,
variables, connection managers and&amp;nbsp;data flow components. You can use XML config
file, config from parent package, registry configuration or even configuration from
a table.&lt;/li&gt;
&lt;li&gt;
The Cache Transformation saves data in the cache. It's very useful in lookups.&lt;/li&gt;
&lt;li&gt;
Data types: Make them as "small" as possible (better performance).&amp;nbsp;Be aware&amp;nbsp;of
precision issues when using money, float and decimal types.&lt;/li&gt;
&lt;li&gt;
Don't sort in SSIS unless it's absolutely necessary.&lt;/li&gt;
&lt;li&gt;
Sometimes using T-SQL will be faster then running it in SSIS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Some of the tips are also relevant in Informatica. For example, I always let the DB
make the sort whenever possible. Sometimes it's also works with joins. Running packages
or procedures can be much more faster than running it in the ETL, but if you look
at it from maintenance point of view you'll do it in the ETL. It depends on much factors,
such as the time you can have to run the ETL, the knowledge in your team and more.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,43cbf1b9-4b77-4d7c-b8e9-5aa2dbf584d3.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services;BI/SQL Server 2008;BI/SQL Server 2008/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=6537c330-ca32-4855-9313-e798a37981ec</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,6537c330-ca32-4855-9313-e798a37981ec.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,6537c330-ca32-4855-9313-e798a37981ec.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6537c330-ca32-4855-9313-e798a37981ec</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>This is the third post about <a href="http://blogs.microsoft.co.il/blogs/itaybraun/">Itay
Braun</a></em>
          <em>'s seminar in the SQL &amp; BI conference. In this post, I'll write
some notes I collected from the second part of the seminar which discussed SSAS design,
but here I'll focus on near real-time cubes. I decided to write an independent post
about near real-time cubes because this subject deserves its own place. By the
way, I personally think that this subject is very interesting.</em>
        </p>
        <p>
There are several solutions to implement near real-time cubes:
</p>
        <ol>
          <li>
Processing only the last partition. Pros: Trivial and simple. Cons: Might impact users
in terms of resources and cache.</li>
          <li>
Small real-time cube. Pros: Simple and elegant solution. Cons: It's small,
so it can't contain much data even if you need to. This is the main reason why people
usually don't do it.</li>
          <li>
Backend processing server. Now it's getting interesting. The backend server is only
used for processing. The front-end server(s) is used for querying. Pros: Good performance
on query time. Cons: You need to take care of syncing the cubes, using XMLA sync,
physical file sync (SAN snapshots) or any other technology. The cache is deleted
with every sync.</li>
          <li>
Flip-Flop. It's like the previous solution, only here we switch between the servers.
Pros: It enables you to check your data/cube before making the switch. Good performance
on query time. Cons: You need to take care of changing the connection string in the
client side or implement NLB solution. It might disconnect users or you need to take
care of waiting for the end of the session and only then change the connection string.</li>
          <li>
ROLAP partition. Pros: No processing at all! Cons: Bad, bad performance.</li>
        </ol>
        <p>
If anyone have implemented one of these I'll be happy to hear.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=6537c330-ca32-4855-9313-e798a37981ec" />
      </body>
      <title>Notes from the SQL &amp; BI conference - Near Real-Time Cubes</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,6537c330-ca32-4855-9313-e798a37981ec.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,6537c330-ca32-4855-9313-e798a37981ec.aspx</link>
      <pubDate>Tue, 22 Jun 2010 12:17:34 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;This is the&amp;nbsp;third post about &lt;a href="http://blogs.microsoft.co.il/blogs/itaybraun/"&gt;Itay
Braun&lt;/a&gt;&lt;/em&gt;&lt;em&gt;'s seminar in the SQL &amp;amp; BI conference. In this post, I'll write
some notes I collected from the second part of the seminar which discussed SSAS design,
but here I'll focus on near real-time cubes. I decided to write an independent&amp;nbsp;post
about&amp;nbsp;near real-time cubes because this subject deserves its own place. By the
way, I personally think that this subject is very interesting.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
There are several solutions to implement near real-time cubes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Processing only the last partition. Pros: Trivial and simple. Cons: Might impact users
in terms of resources and cache.&lt;/li&gt;
&lt;li&gt;
Small real-time cube. Pros:&amp;nbsp;Simple and elegant solution.&amp;nbsp;Cons: It's small,
so it can't contain much data even if you need to. This is the main reason why people
usually don't do it.&lt;/li&gt;
&lt;li&gt;
Backend processing server. Now it's getting interesting. The backend server is only
used for processing. The front-end server(s) is used for querying. Pros: Good performance
on query time. Cons: You need to take care of syncing the cubes, using XMLA sync,
physical file sync (SAN snapshots)&amp;nbsp;or any other technology. The cache is deleted
with every sync.&lt;/li&gt;
&lt;li&gt;
Flip-Flop. It's like the previous solution, only here we switch between the servers.
Pros: It enables you to check your data/cube before making the switch. Good performance
on query time. Cons: You need to take care of changing the connection string in the
client side or implement NLB solution. It might disconnect users or you need to take
care of waiting for the end of the session and only then change the connection string.&lt;/li&gt;
&lt;li&gt;
ROLAP partition. Pros: No processing at all! Cons: Bad, bad&amp;nbsp;performance.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
If anyone have implemented one of these I'll be happy to hear.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=6537c330-ca32-4855-9313-e798a37981ec" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,6537c330-ca32-4855-9313-e798a37981ec.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=de92bdd9-8397-40b5-a969-035a17897699</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,de92bdd9-8397-40b5-a969-035a17897699.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,de92bdd9-8397-40b5-a969-035a17897699.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=de92bdd9-8397-40b5-a969-035a17897699</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is the second post about <a href="http://blogs.microsoft.co.il/blogs/itaybraun/">Itay
Braun</a>'s seminar in the SQL &amp; BI conference. In this post, I'll write some
notes I collected from the second part of the seminar which discussed SSAS design.
</p>
        <ul>
          <li>
There's a very common misunderstanding about what is an entity. You can see it
when there are a lot of dimensions. If there are "car color", "car manufacturer"
and "car creation year" dimensions it seems you've got a problem. If there are dimensions
with only key and description attributes (or worse - only one description attribute)
then you've got a serious problem. 
</li>
          <li>
Design to Scale: Often the performance problem are caused by the dimensions and
not by the fact/cubes. 
</li>
          <li>
Don't develop SSAS with hebrew (or any other right-to-left language). Use hebrew only
in translations .I've personally got hurt with this. Maintaining MDX with hebrew is
hell. 
</li>
          <li>
Avoid using linked measures. If you have some, consider joining the cubes to one cube. 
</li>
          <li>
There need to be a balance between the amount of the dimensions and the amount of
the cubes. If they are equal, you've got a problem. BIDS will warn you (in the 2008
version) if you have two measure groups with the same dimensionality. 
</li>
          <li>
Keep the dimension keys as narrow as possible. Dimension keys based on more than one
column is not optimal. Use member properties, such as AttributeHierarchyEnabled, AttributeHierarchyOptimized
and GroupingBehaviour. 
</li>
          <li>
Data types is an issue in SSAS. Make sure the data types in the DSV are the same as
in the dimension attributes. 
</li>
          <li>
The SSAS engine works best when the foreign key between the fact and the dimension
is based on integer columns. Read more about dimension design <a href="http://sqlcat.com/whitepapers/archive/2009/02/15/the-analysis-services-2008-performance-guide.aspx">here</a>. 
</li>
          <li>
Attribute relationships and flexible vs. rigid are critical to performance.
As I read more and more about SSAS I understand how much it's crucial to performance. 
</li>
          <li>
Automatic creation of partitions can be a good solution for a wide variety of problems.
Note that when deploying your SSAS solution to the server you might override the partitions
you created with your code. To solve this, you can use the deployment wizard or to <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx">import
your SSAS database into solution</a>. 
</li>
          <li>
Each partition should have up to 50M records or up to 250MB. Optimize the partition
query. It's only plain SQL query. Get help from your DBA and get a better performance. 
</li>
          <li>
99% Aggregations will not cover 99% of the aggregation possibilities/combinations.
The engine chooses statistically-randomly which aggregation to save. Use the usage
based wizard. 
</li>
          <li>
Most of the processing time is the time required for the relational DB to return the
results of the SQL query. As before, get help from the DBA, improve this query (note
that you can't change it) and get a shorter processing time. 
</li>
          <li>
To solve MDX performance issues, you need to learn what is the difference between
the formula engine and the storage engine. I was suprised to see that many SSAS developers
never heard of it. 
</li>
          <li>
In MDX Scripts, use scoping instead of conditional calculations when possible. 
</li>
          <li>
Avoid StrToMember or StrToSet functions.</li>
        </ul>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=de92bdd9-8397-40b5-a969-035a17897699" />
      </body>
      <title>Notes from the SQL &amp; BI conference - SSAS Design</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,de92bdd9-8397-40b5-a969-035a17897699.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,de92bdd9-8397-40b5-a969-035a17897699.aspx</link>
      <pubDate>Mon, 14 Jun 2010 11:34:43 GMT</pubDate>
      <description>&lt;p&gt;
This is the second post about &lt;a href="http://blogs.microsoft.co.il/blogs/itaybraun/"&gt;Itay
Braun&lt;/a&gt;'s seminar in the SQL &amp;amp; BI conference. In this post, I'll write some
notes I collected from the second part of the seminar which discussed SSAS design.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
There's a&amp;nbsp;very common misunderstanding about what is an entity. You can see it
when there are a lot of dimensions. If there&amp;nbsp;are "car color", "car manufacturer"
and "car creation year" dimensions it seems you've got a problem. If there are dimensions
with only key and description attributes (or worse - only one description attribute)
then you've got a serious problem. 
&lt;li&gt;
Design to Scale: Often the performance problem are caused by the dimensions&amp;nbsp;and
not&amp;nbsp;by the fact/cubes. 
&lt;li&gt;
Don't develop SSAS with hebrew (or any other right-to-left language). Use hebrew only
in translations .I've personally got hurt with this. Maintaining MDX with hebrew is
hell. 
&lt;li&gt;
Avoid using linked measures. If you have some, consider joining the cubes to one cube. 
&lt;li&gt;
There need to be a balance between the amount of the dimensions and the amount of
the cubes. If they are equal, you've got a problem. BIDS will warn you (in the 2008
version) if you have two measure groups with the same dimensionality. 
&lt;li&gt;
Keep the dimension keys as narrow as possible. Dimension keys based on more than one
column is not optimal. Use member properties, such as AttributeHierarchyEnabled, AttributeHierarchyOptimized
and GroupingBehaviour. 
&lt;li&gt;
Data types is an issue in SSAS. Make sure the data types in the DSV are the same as
in the dimension attributes. 
&lt;li&gt;
The SSAS engine works best when the foreign key between the fact and the dimension
is based on integer columns. Read more about dimension design &lt;a href="http://sqlcat.com/whitepapers/archive/2009/02/15/the-analysis-services-2008-performance-guide.aspx"&gt;here&lt;/a&gt;. 
&lt;li&gt;
Attribute relationships and&amp;nbsp;flexible vs. rigid&amp;nbsp;are critical to performance.
As I read more and more about SSAS I understand how much it's crucial to performance. 
&lt;li&gt;
Automatic creation of partitions can be a good solution for a wide variety of problems.
Note that when deploying your SSAS solution to the server you might override the partitions
you created with your code. To solve this, you can use the deployment wizard or to &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx"&gt;import
your SSAS database into solution&lt;/a&gt;. 
&lt;li&gt;
Each partition should have up to 50M records or up to 250MB. Optimize the partition
query. It's only plain SQL query. Get help from your DBA and get a better performance. 
&lt;li&gt;
99% Aggregations will not cover 99% of the aggregation possibilities/combinations.
The engine chooses statistically-randomly which aggregation to save. Use the usage
based wizard. 
&lt;li&gt;
Most of the processing time is the time required for the relational DB to return the
results of the SQL query. As before, get help from the DBA, improve this query (note
that you can't change it) and get a shorter processing time. 
&lt;li&gt;
To solve MDX performance issues, you need to learn what is the difference between
the formula engine and the storage engine. I was suprised to see that many SSAS developers
never heard of it. 
&lt;li&gt;
In MDX Scripts, use scoping instead of conditional calculations when possible. 
&lt;li&gt;
Avoid StrToMember or StrToSet functions.&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=de92bdd9-8397-40b5-a969-035a17897699" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,de92bdd9-8397-40b5-a969-035a17897699.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=f64785b0-e1a6-4033-bff9-8c6e8219ce2f</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,f64785b0-e1a6-4033-bff9-8c6e8219ce2f.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,f64785b0-e1a6-4033-bff9-8c6e8219ce2f.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f64785b0-e1a6-4033-bff9-8c6e8219ce2f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
SQL Server 2008 R2 has been released not-so-long-ago. You can <a href="http://www.microsoft.com/sqlserver/2008/en/us/R2Downloads.aspx">download</a> the
trial and check it for yourselves. Alternatively, you can enter the <a href="http://www.microsoft.com/sqlserver/tour/en/default.aspx">digital
tour</a> or read the <a href="http://go.microsoft.com/fwlink/?LinkId=189147">free
e-book</a>. I started reading the e-book and I promise to update here about the new
features of R2.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f64785b0-e1a6-4033-bff9-8c6e8219ce2f" />
      </body>
      <title>Some SQL Server 2008 R2 Sources</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,f64785b0-e1a6-4033-bff9-8c6e8219ce2f.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,f64785b0-e1a6-4033-bff9-8c6e8219ce2f.aspx</link>
      <pubDate>Mon, 10 May 2010 07:51:59 GMT</pubDate>
      <description>&lt;p&gt;
SQL Server 2008 R2 has been released not-so-long-ago. You can &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/R2Downloads.aspx"&gt;download&lt;/a&gt;&amp;nbsp;the
trial&amp;nbsp;and check it&amp;nbsp;for yourselves. Alternatively, you can enter the &lt;a href="http://www.microsoft.com/sqlserver/tour/en/default.aspx"&gt;digital
tour&lt;/a&gt; or read the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=189147"&gt;free
e-book&lt;/a&gt;. I started reading the e-book and I promise to update here about the new
features of R2.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f64785b0-e1a6-4033-bff9-8c6e8219ce2f" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,f64785b0-e1a6-4033-bff9-8c6e8219ce2f.aspx</comments>
      <category>BI;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3</wfw:commentRss>
      <title>History Browsing in OLAP and LastNonEmptyLeaf</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</link>
      <pubDate>Wed, 03 Mar 2010 12:34:48 GMT</pubDate>
      <description>&lt;img style="MARGIN: 0px 1em 1em" height="50%" src="http://www.miky-schreiber.com/Blog/content/binary/time.jpg" width="25%" align=left&gt; One
of the basic requirements of a modern BI system or Data Warehouse is to be non-volatile,
meaning that the DWH will save the history. In this post I'll explain how to implement
it in the DWH while assuming that the history can be changed and (the more interesting
part) how to implement it in Analysis Services.&lt;br&gt;
&lt;p&gt;
Before starting with history saving in the DWH,&amp;nbsp;I need to say that this has nothing
to do with Slowly Changing Dimensions. You can work with Type 1, 2 or 3. All you need
to take care of is that the fact table will be consistent with the dimension tables.
Assuming that the history can change (this is&amp;nbsp;the scenario&amp;nbsp;in my organization),
we need to extract all the fact data every time. If you work with staging level/environment/layer
you can use it to calculate which records has been changed or&amp;nbsp;inserted&amp;nbsp;and
only upsert them&amp;nbsp;to the DWH itself (it's more secure). In our case, we'll work
without such staging level so we need to load all the fact data in every load to the
DWH.
&lt;/p&gt;
&lt;p&gt;
Loading&amp;nbsp;the fact&amp;nbsp;in the ETL is very simple - we'll&amp;nbsp;save the&amp;nbsp;datetime
of the execution start, round it&amp;nbsp;and put it in every&amp;nbsp;row in the fact table.
We can call this field&amp;nbsp;CreateTime. You probably ask yourself why we need to round
it. The answer is that we don't want the time dimension to have every possible value
of datetime. It's huge and the users don't need that kind of accuracy. That's why
I round it in my projects to half-hour, meaning that 14:27 becomes 14:00 and 14:50
becomes 14:30. Let's look at an example of such fact table:
&lt;/p&gt;
&lt;p&gt;
&lt;table style="WIDTH: 389pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=518 border=0 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 50pt; mso-width-source: userset; mso-: 2450" width=67&gt;
&lt;col style="WIDTH: 63pt; mso-width-source: userset; mso-: 3072" span=2 width=84&gt;
&lt;col style="WIDTH: 53pt; mso-width-source: userset; mso-: 2560" span=2 width=70&gt;
&lt;col style="WIDTH: 107pt; mso-width-source: userset; mso: 5229" width=143&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-: transparent" width=67 height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;RowNum&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 63pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=84&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Dimension1&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 63pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=84&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Dimension2&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 53pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=70&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Measure1&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; P&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 53pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=70&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Measure2&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; P&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl23 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 107pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=143&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;font face=Arial color=#000000 size=2&gt;CreateTime&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;A&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;20&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;56&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;19&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;C&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;A&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;20&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;56&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;40&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;8&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;9&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;C&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Here we can see two executions of the ETL: The first between 15:00 and 15:00, the
second between 15:31 and 15:59. Note the differences in rows 2 vs. 7 and 4 vs. 9.
This means that the source table(s) has changed between the executions.
&lt;/p&gt;
&lt;p&gt;
In the DWH, we create foreign keys from Dimension1 and Dimension2 to their dimension
tables. We'll also create FK between CreateTime and the time dimension. I won't get
into the time dimension design here, you can read about it&amp;nbsp;a &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,73f9d050-05bd-4dc9-b719-ae9d256557b3.aspx"&gt;past
post&lt;/a&gt;. I assume that the time dimension has the hierarchy Year -&amp;gt; Month -&amp;gt;
Day -&amp;gt; Hour -&amp;gt; Half-Hour. It seems that now we have a good fact table for use
in Reporting Services (or any other reporting tool). Create a parameter called Extraction
Time/ETL Time and assign it values from distinct on CreateTime. The user can pick
a date and the report will filter on this date. Perfect.
&lt;/p&gt;
&lt;p&gt;
The problematic part starts in Analysis Services. &lt;strong&gt;Only one extraction time
can be the current member. There is no sense in summing or aggregating more than one
extraction time.&lt;/strong&gt; There are two ways to deal with it:
&lt;/p&gt;
&lt;u&gt;The wrong way&lt;/u&gt; - I'm writing&amp;nbsp;this down so you'll learn from this &lt;em&gt;design
mistake&lt;/em&gt;. We created a calculated member which takes the last extraction time: 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Create Member CurrentCube.[Extraction Time]. [Calendar].[All].[Last Data Time]&lt;br&gt;
AS&lt;br&gt;
Tail ([Extraction Time].[Calendar].[HALF HOUR].Members,1).Item(0),&lt;br&gt;
Visible = 1; 
&lt;p&gt;
In every Panorama view, we sliced the Extraction time on the [Last Data Time] member,
which will show the user the data of the last ETL run. Our basic assumption was that
the user wants to see the current data and when he'll want to see the historical data
he will pick another member from the Extraction time dimension. This is the point
we missed and it soon&amp;nbsp; enough bumped into our face. 
&lt;p&gt;
We forgot that every system, even BI system which is built for analysts should be
intuitive and idiot-proof. The users picked members from the day level in the Extraction
time dimension. When we asked them why they did it they said that "we wanted to see
the data from 03/03/2010 and suddenly the numbers got bigger!". That happened, of
course, because the member 03/03/2010 is the sum of 03/03/2010 15:00 and 03/03/2010
15:30. The solution is that no matter which member the user picks in the Extraction
time dimension, he should see only one leaf (half-hour level) member at a time. This
takes us to 
&lt;p&gt;
&lt;u&gt;The right way&lt;/u&gt; - We set the [Last Data Time] member to be visible = 0 (I kept
it for debug purposes) and I written MDX script which I call NonLastEmptyLeaf. This
script makes sure that&amp;nbsp;no matter which member in the Extraction time hierarchy
will be picked, the user will be sliced only on the last non empty leaf. For example,
if the user picks 03/03/2010 he will see the data of 03/03/2010 15:30. This is what
will happen also when he'll slice on 03/2010, 2010 and even the [All] member. This
is the MDX script:&lt;br&gt;
&lt;br&gt;
Freeze([Extraction time].[Calendar].[All]);&lt;br&gt;
Scope(&lt;br&gt;
&amp;nbsp; Descendants (&lt;br&gt;
&amp;nbsp;&amp;nbsp; [Extraction time].[Calendar]. [All],&lt;br&gt;
&amp;nbsp;&amp;nbsp; 0,&lt;br&gt;
&amp;nbsp;&amp;nbsp; SELF_AND_AFTER&lt;br&gt;
&amp;nbsp; )&lt;br&gt;
);&lt;br&gt;
&amp;nbsp; this = Tail (&lt;br&gt;
&amp;nbsp;&amp;nbsp; Filter(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Descendants(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Extraction time]. [Calendar].CurrentMember,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Extraction time].[Calendar].[HALF HOUR],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEAVES&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Measures].CurrentMember &amp;gt; 0&lt;br&gt;
&amp;nbsp;&amp;nbsp; ) 
&lt;br&gt;
&amp;nbsp; ).Item(0);&lt;br&gt;
End Scope;
&lt;/p&gt;
&lt;p&gt;
Now, there is no meaning of [Last Data Time] member because slicing on the [All] member
will show the current data, meaning that no slicing at all will show the current data
because [All] is the default member.
&lt;/p&gt;
&lt;p&gt;
To conclude,&amp;nbsp;history browsing can be dangerous if we let the users the option
to slice on more than one data time. The open question that I have is how can I prevent
the user from picking more than one member in this hierarchy in Panorama views? Should
I even try to do that or should I count on his minimal common sense?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=51a6ed33-2855-4d28-af43-6af5d6c8ecd6</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=51a6ed33-2855-4d28-af43-6af5d6c8ecd6</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <title>Text in OLAP Measures</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</link>
      <pubDate>Sun, 14 Feb 2010 12:49:00 GMT</pubDate>
      <description>&lt;p&gt;
I knew for a long time that measures can have text and not only numbers, but last
week I had a scenario where it was the perfect solution for my problem.
&lt;/p&gt;
&lt;p&gt;
Let's say that I work in number of jobs. In every job I got some tasks that I need
to do. The fact table looks like this:
&lt;/p&gt;
&lt;p&gt;
&lt;table style="WIDTH: 319pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=425 border=0 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99&gt;
&lt;col style="WIDTH: 89pt; mso-width-source: userset; mso-width-alt: 4315" width=118&gt;
&lt;col style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99&gt;
&lt;col style="WIDTH: 82pt; mso-width-source: userset; mso-width-alt: 3986" width=109&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=99 height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Job&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 89pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=118&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Task&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=99&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Tasks To Do&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 82pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=109&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;font face=Arial color=#000000 size=2&gt;Tasks Completed&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Developer&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Develop BI System&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Developer&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Help Friends&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Manager&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Manage&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Therapist&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Summarizing the "Tasks To Do" column will get the total tasks that I need to do. Summarizing
the "Tasks Completed" column will get the tasks that I did. Note that in the Therapist
job I didn't get any tasks.&lt;br&gt;
In the OLAP cube, I created a calculated measure which is the percent of the completed
tasks (for every job or for any other dimension). The&amp;nbsp;problem is: What is the
answer in case that there are no any tasks to do? Some will say 0% and some will say
100%. That's why a text measure such as "There are no tasks" can be a perfect solution
for this kind of problem. This is the calculation of the calculated measure:
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Create Member CurrentCube.[Measures].[Completed Percentage] as&lt;br&gt;
IIF(IsEmpty([Measures].[Tasks To Do]),&lt;br&gt;
&amp;nbsp;&amp;nbsp;null,&lt;br&gt;
&amp;nbsp;&amp;nbsp;IIF([Measures].[Tasks To Do] = 0),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'There are no tasks',&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Measures].[Completed Tasks] / [Measures].[Tasks To Do]&lt;br&gt;
&amp;nbsp;&amp;nbsp;)&lt;br&gt;
)&lt;br&gt;
This scenario can happen in many cubes. Tell me if you have any other solution for
this kind of problem.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;u&gt;Update:&lt;/u&gt;&lt;/em&gt; Read the important comments below.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=51a6ed33-2855-4d28-af43-6af5d6c8ecd6" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=801cefae-7de4-4e1c-9ad4-115c70c2813e</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,801cefae-7de4-4e1c-9ad4-115c70c2813e.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,801cefae-7de4-4e1c-9ad4-115c70c2813e.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=801cefae-7de4-4e1c-9ad4-115c70c2813e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img style="MARGIN: 0px 1em 1em" height="50%" src="http://www.miky-schreiber.com/blog/content/binary/horseshoe.jpg" width="25%" align="left" />In
both SSIS and Informatica, the union transformation doesn't delete duplicate rows.
In SSIS it's clear because the transformation is called "Union all", which reminds
us the union all statement in SQL which doesn't remove duplicate rows. The confusing
part is in Informatica, where the transformation is called Union although it doesn't
remove duplicates. One of my teammates got confused this week so I thought it's worth
blogging about. 
<br /><br />
One more tip about ETLs with union transformations: When you'll investigate, maintain
or fix ETL it will be much help if you'll know where each row came from. That's why
I recommend adding a column named "src" or something like that and store there the
source of the row before the union happened.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=801cefae-7de4-4e1c-9ad4-115c70c2813e" />
      </body>
      <title>Union Transformations and Duplicate Rows</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,801cefae-7de4-4e1c-9ad4-115c70c2813e.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,801cefae-7de4-4e1c-9ad4-115c70c2813e.aspx</link>
      <pubDate>Mon, 09 Nov 2009 14:41:31 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img style="MARGIN: 0px 1em 1em" height="50%" src="http://www.miky-schreiber.com/blog/content/binary/horseshoe.jpg" width="25%" align=left&gt;In
both SSIS and Informatica, the union transformation doesn't delete duplicate rows.
In SSIS it's clear because the transformation is called "Union all", which reminds
us the union all statement in SQL which doesn't remove duplicate rows. The confusing
part is in Informatica, where the transformation is called Union although it doesn't
remove duplicates. One of my teammates got confused this week so I thought it's worth
blogging about. 
&lt;br&gt;
&lt;br&gt;
One more tip about ETLs with union transformations: When you'll investigate, maintain
or fix ETL it will be much help if you'll know where each row came from. That's why
I recommend adding a column named "src" or something like that and store there the
source of the row before the union happened.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=801cefae-7de4-4e1c-9ad4-115c70c2813e" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,801cefae-7de4-4e1c-9ad4-115c70c2813e.aspx</comments>
      <category>BI;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services;BI/SQL Server 2008;BI/SQL Server 2008/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=03a8f9ca-790a-4e8a-91e3-f25ea1a32c94</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,03a8f9ca-790a-4e8a-91e3-f25ea1a32c94.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,03a8f9ca-790a-4e8a-91e3-f25ea1a32c94.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=03a8f9ca-790a-4e8a-91e3-f25ea1a32c94</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img style="MARGIN: 0px 1em 1em" src="http://www.miky-schreiber.com/blog/content/binary/policeman.jpg" align="left" />
        <p>
Lucky for me, I have the opportunity to work with more than one ETL tool in my daily
work. In the far past, I worked much with DTS and PL/SQL packages (which is an ETL,
but not exactly a tool). Nowadays I work both with SSIS and Informatica so I
can compare them in several aspects. I don't think that one is better than the other.
It's just that they have different approaches to the ETL mechanism. Anyway, I always
expect that the data transformations will behave the same in every tool and I
found one transformation that behaves differently between the tools - the Router.
</p>
        <p>
The Informatica's Router, if you're not familiar with, receives a data row and
routes it a specific data flow. Its parallel transformation in SSIS is the Conditional
Split. As I said, I always thought that they behave the same. In both transformations
you provide boolean expressions that determine where the row will be routed. The difference
is that in SSIS, "<em>each input row can be sent to only one output, that being the
output for the first condition that evaluates to true</em>" (from SSIS's documentation).
In programmer's words, it behaves like switch-case statement with break in each condition.
In Informatica, <em>"If a row meets more than one group filter condition, the Integration
Service passes this row multiple times</em>" (from Informatica's documentation). Back
to the programmer's language, it's like switch-case statement with no break inside
the conditions.
</p>
        <p>
If you know other transformation that behaves different between ETL tools, I'll be
happy to know.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=03a8f9ca-790a-4e8a-91e3-f25ea1a32c94" />
      </body>
      <title>Different Router behaviour in SSIS and Informatica</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,03a8f9ca-790a-4e8a-91e3-f25ea1a32c94.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,03a8f9ca-790a-4e8a-91e3-f25ea1a32c94.aspx</link>
      <pubDate>Tue, 27 Oct 2009 14:10:34 GMT</pubDate>
      <description>&lt;img style="MARGIN: 0px 1em 1em" src="http://www.miky-schreiber.com/blog/content/binary/policeman.jpg" align=left&gt; 
&lt;p&gt;
Lucky for me, I have the opportunity to work with more than one ETL tool in my daily
work. In the far past, I worked much with DTS and PL/SQL packages (which is an ETL,
but not exactly a tool). Nowadays I work both with&amp;nbsp;SSIS and Informatica so I
can compare them in several aspects. I don't think that one is better than the other.
It's just that they have different approaches to the ETL mechanism. Anyway, I always
expect that the data transformations will behave the same in every tool&amp;nbsp;and I
found one transformation that behaves differently between the tools - the Router.
&lt;/p&gt;
&lt;p&gt;
The&amp;nbsp;Informatica's Router, if you're not familiar with, receives a data row and
routes it a specific data flow. Its parallel transformation in SSIS is the Conditional
Split. As I said, I always thought that they behave the same. In both transformations
you provide boolean expressions that determine where the row will be routed. The difference
is that in SSIS, "&lt;em&gt;each input row can be sent to only one output, that being the
output for the first condition that evaluates to true&lt;/em&gt;" (from SSIS's documentation).
In programmer's words, it behaves like switch-case statement with break in each condition.
In Informatica, &lt;em&gt;"If a row meets more than one group filter condition, the Integration
Service passes this row multiple times&lt;/em&gt;" (from Informatica's documentation). Back
to the programmer's language, it's like switch-case statement with no break inside
the conditions.
&lt;/p&gt;
&lt;p&gt;
If you know other transformation that behaves different between ETL tools, I'll be
happy to know.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=03a8f9ca-790a-4e8a-91e3-f25ea1a32c94" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,03a8f9ca-790a-4e8a-91e3-f25ea1a32c94.aspx</comments>
      <category>BI;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services;BI/SQL Server 2008;BI/SQL Server 2008/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=e8983b76-ab68-4cf3-824b-77b340acc19c</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,e8983b76-ab68-4cf3-824b-77b340acc19c.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,e8983b76-ab68-4cf3-824b-77b340acc19c.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e8983b76-ab68-4cf3-824b-77b340acc19c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Very easy. In Sql Server:<br />
Select top n * from my_table<br />
In Oracle:<br />
Select * from my_table where rownum &lt;= n<br /><p>
It can be very useful in many many cases. For example, you're designing DWH over a
system and you're looking at a certain field in one of its tables. You want to know
which values this field contains, but fetching "select distinct my_field from my_table"
takes too much time. Instead, if you <strike>believe</strike> know that the data is
well distributed, you can use "select distinct my_field from my_table where rownum
&lt;= n". Use 1000 for n in the first trial and add one zero in the end of the number
n every time until you got a query that takes too much time than you want to wait. after
you got the n you can live with, can use the values you have in your query result.
</p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e8983b76-ab68-4cf3-824b-77b340acc19c" /></body>
      <title>Fetching N Rows In Sql Server and Oracle</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,e8983b76-ab68-4cf3-824b-77b340acc19c.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,e8983b76-ab68-4cf3-824b-77b340acc19c.aspx</link>
      <pubDate>Tue, 07 Apr 2009 19:54:28 GMT</pubDate>
      <description>Very easy. In Sql Server:&lt;br&gt;
Select top n * from my_table&lt;br&gt;
In Oracle:&lt;br&gt;
Select * from my_table where rownum &amp;lt;= n&lt;br&gt;
&lt;p&gt;
It can be very useful in many many cases. For example, you're designing DWH over a
system and you're looking at a certain field in one of its tables. You want to know
which values this field contains, but fetching "select distinct my_field from my_table"
takes too much time. Instead, if you &lt;strike&gt;believe&lt;/strike&gt; know that the data is
well distributed, you can use "select distinct my_field from my_table where rownum
&amp;lt;= n". Use 1000 for n in the first trial and add one zero in the end of the number
n every time until you got a query that takes too much time than you want to wait.&amp;nbsp;after
you&amp;nbsp;got the n you can live with, can use the values you have in your query result.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e8983b76-ab68-4cf3-824b-77b340acc19c" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,e8983b76-ab68-4cf3-824b-77b340acc19c.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/SQL Server 2005;BI/SQL Server 2008;BI/Oracle</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=cbc9ec2a-6745-411d-ba63-19561dc9f411</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,cbc9ec2a-6745-411d-ba63-19561dc9f411.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,cbc9ec2a-6745-411d-ba63-19561dc9f411.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=cbc9ec2a-6745-411d-ba63-19561dc9f411</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There are some things you can only learn in the hard way. It didn't happenned
to me personally but to my team friends, so I consider it as it is my bad.
</p>
        <p>
We upgraded our ETL tool - Informatica, from version 8.5 to 8.6. We had to run
some tests to see that the results are the same. So, what we did is to save the result
table from 8.5 in Excel, save the result table from 8.6 in Excel and then compare
them using Excel-built-in functions. The only problem is we didn't pay attention to
the places where zero and null interchanged. This happened because the two versions
act differently where null values take places in aggregation functions. For example,
when there is a sum function and it aggregates only on null values. In one version
the output is zero and in the other the output is null... 
</p>
        <p>
This can also happen in other tools and technology. For example, in OLAP cubes the
difference between zero and null is the difference between seeing the member of the
dimension on the screen and not knowing of its existence.
</p>
        <p>
For conclusion, always be aware to this point and don't forget to check it.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=cbc9ec2a-6745-411d-ba63-19561dc9f411" />
      </body>
      <title>The Difference between null and zero</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,cbc9ec2a-6745-411d-ba63-19561dc9f411.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,cbc9ec2a-6745-411d-ba63-19561dc9f411.aspx</link>
      <pubDate>Sun, 22 Mar 2009 21:09:59 GMT</pubDate>
      <description>&lt;p&gt;
There are some things you can only learn&amp;nbsp;in&amp;nbsp;the hard way. It didn't happenned
to me personally but to my team friends, so I consider it as it is my bad.
&lt;/p&gt;
&lt;p&gt;
We upgraded our ETL tool&amp;nbsp;- Informatica, from version 8.5 to 8.6. We had to&amp;nbsp;run
some tests to see that the results are the same. So, what we did is to save the result
table from 8.5 in Excel, save the result table from 8.6 in Excel and then compare
them using Excel-built-in functions. The only problem is we didn't pay attention to
the places where zero and null interchanged. This happened because the two versions
act differently where null values take places in aggregation functions. For example,
when there is a sum function and it aggregates only on null values. In one version
the output is zero and in the other the output is null... 
&lt;/p&gt;
&lt;p&gt;
This can also happen in other tools and technology. For example, in OLAP cubes the
difference between zero and null is the difference between seeing the member of the
dimension on the screen and not knowing of its existence.
&lt;/p&gt;
&lt;p&gt;
For conclusion, always be aware to this point and don't forget to check it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=cbc9ec2a-6745-411d-ba63-19561dc9f411" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,cbc9ec2a-6745-411d-ba63-19561dc9f411.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=eb554b6c-8e46-4030-b2b9-5a9aac6689f7</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,eb554b6c-8e46-4030-b2b9-5a9aac6689f7.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,eb554b6c-8e46-4030-b2b9-5a9aac6689f7.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=eb554b6c-8e46-4030-b2b9-5a9aac6689f7</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
You should know that when you run a program by starting a job with a CmdExec step,
the directory in which the program is running in will be c:\&lt;windows dir&gt;\system32.
How can this affect you? For example, I created a .Net console application that has
a settings file with it. When I ran it using the SQL Server Agent, it couldn't find
the settings file (worse - it used the default settings and that caused many trouble
finding the problem). After some research, I found that it's looking for it in the
directory I mentioned.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=eb554b6c-8e46-4030-b2b9-5a9aac6689f7" />
      </body>
      <title>Running program with the SQL Server Agent</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,eb554b6c-8e46-4030-b2b9-5a9aac6689f7.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,eb554b6c-8e46-4030-b2b9-5a9aac6689f7.aspx</link>
      <pubDate>Sat, 03 Jan 2009 21:24:58 GMT</pubDate>
      <description>&lt;p&gt;
You should know that when you run a program by starting a job with a CmdExec step,
the directory in which the program is running in will be c:\&amp;lt;windows dir&amp;gt;\system32.
How can this affect you? For example, I created a .Net console application that has
a settings file with it. When I ran it using the SQL Server Agent, it couldn't find
the settings file (worse - it used the default settings and that caused many trouble
finding the problem). After some research, I found that it's looking for it in the
directory I mentioned.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=eb554b6c-8e46-4030-b2b9-5a9aac6689f7" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,eb554b6c-8e46-4030-b2b9-5a9aac6689f7.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=b8dcb74f-14df-4240-b5be-40c916b301f5</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b8dcb74f-14df-4240-b5be-40c916b301f5</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I had a very disturbing coincidence.<br />
My friend Ariel worked on a SSAS solution with no version control (we're using VSS).
Instead of using that, he developed by opening the database on the server. I told
him that he must fix it and we must have a recent version-controlled solution.
In the past we asked Microsoft support how to do that (we lost all our vss files and
had only the databases). <strong>They simply said that it's not possible</strong>.
Ariel has found today that it can be made very easily using File -&gt; New Project
-&gt; Import Analysis Services Database, as you can see in the picture:
</p>
        <img src="http://www.miky-schreiber.com/Blog/content/binary/importSSASsolutionFromDB.JPG" border="0" />
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b8dcb74f-14df-4240-b5be-40c916b301f5" />
      </body>
      <title>Importing SSAS database to solution</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx</link>
      <pubDate>Wed, 03 Dec 2008 20:09:58 GMT</pubDate>
      <description>&lt;p&gt;
Today I had a very disturbing coincidence.&lt;br&gt;
My friend Ariel worked on a SSAS solution with no version control (we're using VSS).
Instead of using that, he developed by opening the database on the server. I told
him that he must fix it and we must have a&amp;nbsp;recent version-controlled solution.
In the past we asked Microsoft support how to do that (we lost all our vss files and
had only the databases). &lt;strong&gt;They simply said that it's not possible&lt;/strong&gt;.
Ariel has found today that it can be made very easily using File -&amp;gt; New Project
-&amp;gt; Import Analysis Services Database, as you can see in the picture:
&lt;/p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/importSSASsolutionFromDB.JPG" border=0&gt;&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b8dcb74f-14df-4240-b5be-40c916b301f5" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,b8dcb74f-14df-4240-b5be-40c916b301f5.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=ee118b93-9ffa-4f4c-aaea-52700b6c6d3c</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,ee118b93-9ffa-4f4c-aaea-52700b6c6d3c.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,ee118b93-9ffa-4f4c-aaea-52700b6c6d3c.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ee118b93-9ffa-4f4c-aaea-52700b6c6d3c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is a little bit tricky. Unlike the AdomdClient assembly, the AdomdServer assembly 
doesn't have a descriptive name. It's called msmgdsrv.dll and it is located in Program
Files\Microsoft SQL Server\MSSQL.2\OLAP\bin. Why it's not documented anywhere?<br /></p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=ee118b93-9ffa-4f4c-aaea-52700b6c6d3c" />
      </body>
      <title>Finding the AdomdServer assembly</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,ee118b93-9ffa-4f4c-aaea-52700b6c6d3c.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,ee118b93-9ffa-4f4c-aaea-52700b6c6d3c.aspx</link>
      <pubDate>Tue, 18 Nov 2008 14:17:16 GMT</pubDate>
      <description>&lt;p&gt;
This is a little bit tricky. Unlike the AdomdClient assembly, the AdomdServer assembly&amp;nbsp;
doesn't have a descriptive name. It's called msmgdsrv.dll and it is located in Program
Files\Microsoft SQL Server\MSSQL.2\OLAP\bin. Why it's not documented anywhere?&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=ee118b93-9ffa-4f4c-aaea-52700b6c6d3c" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,ee118b93-9ffa-4f4c-aaea-52700b6c6d3c.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After announcing the <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx">MdxInjection
program</a> I got several requests for additional details and for the ability to run
it without using Visual Studio. So, here are some important points:
</p>
        <ul>
          <li>
When I published it I had developers in mind because I'm sure than anyone will want
to do his little modification before using it for his own needs. That's why I published
it as a solution and not as executable. 
</li>
          <li>
I written it down using VS2008 but only with the .Net 2 framework. Those of you who
uses VS2005 won't be able to open the solution. 
</li>
          <li>
The program has only one public method - InjectMdx, who takes two arguments: The location
of the CommonMdx file and the location of the xml configuration file. 
</li>
          <li>
The CommonMdx.mdx file contains the common MDX script. The relevant part has
to start with /* Common MDX */ and then the common mdx script. Anything written before
it won't be treated. That gives you the ability to save some data or comments for
yourself in this file. 
</li>
          <li>
Example of the configuration xml file can be found in the Test libary inside the solution.
Basically, it enable you to define in which servers, databases and cubes you want
to inject the common script. Pay attention that you have to write the connection strings
in this file. 
</li>
          <li>
Note that the program will detect cube dimensions with their name changed and will
know how to replace them. That means that if you mention the Time dimension in the
common script and inject it to AdventureWorks cube, the script will replace the string
"Time" with the "ShipmentDate" string, for example.</li>
        </ul>
        <p>
For those of you who want simple execution file, I added a windows console project
in the solution.
</p>
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjectionConsoleApp.zip">Link
to only executable program</a>
        <br />
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection2.zip">Link
to the solution with the added windows application project</a>
        <br />
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip">Link
to the solution without the windows application project</a>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd" />
      </body>
      <title>The MdxInjection Program - continued</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</link>
      <pubDate>Mon, 17 Nov 2008 21:54:17 GMT</pubDate>
      <description>&lt;p&gt;
After announcing the &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx"&gt;MdxInjection
program&lt;/a&gt; I got several requests for additional details and for the ability to run
it without using Visual Studio. So, here are some important points:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
When I published it I had developers in mind because I'm sure than anyone will want
to do his little modification before using it for his own needs. That's why I published
it as a solution and not as executable. 
&lt;li&gt;
I written it down using VS2008 but only with the .Net 2 framework. Those of you who
uses VS2005 won't be able to open the solution. 
&lt;li&gt;
The program has only one public method - InjectMdx, who takes two arguments: The&amp;nbsp;location
of the CommonMdx file and the location of the xml configuration file. 
&lt;li&gt;
The CommonMdx.mdx file contains the common MDX script. The relevant part&amp;nbsp;has
to start with /* Common MDX */ and then the common mdx script. Anything written before
it won't be treated. That gives you the ability to save some data or comments for
yourself in this file. 
&lt;li&gt;
Example of the configuration xml file can be found in the Test libary inside the solution.
Basically, it enable you to define in which servers, databases and cubes you want
to inject the common script. Pay attention that you have to write the connection strings
in this file. 
&lt;li&gt;
Note that the program will detect cube dimensions with their name changed and will
know how to replace them. That means that if you mention the Time dimension in the
common script and inject it to AdventureWorks cube, the script will replace the&amp;nbsp;string
"Time"&amp;nbsp;with the "ShipmentDate" string, for example.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
For those of you who want simple execution file, I added a windows console project
in the solution.
&lt;/p&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjectionConsoleApp.zip"&gt;Link
to only executable program&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection2.zip"&gt;Link
to the solution with the added windows application project&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip"&gt;Link
to the solution without the windows application project&lt;/a&gt;&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services;Programming;Programming/.Net</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=aca4f6ce-32bb-47ab-a453-5b23c25b3d48</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=aca4f6ce-32bb-47ab-a453-5b23c25b3d48</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,f5f76417-9128-4fd7-a8d6-ba60619df30e.aspx">previous
post</a> I talked about the DRY principle in the BI Development. I mentioned that
one of the major problems in the principle's implementation is in the common MDX code. <a href="http://cwebbbi.spaces.live.com/">Chris</a> Commented:
</p>
        <p>
"I'd like to be able to have a global MDX Script and be able to do something like
a #include to bring calculations into specific cubes. One to add to my wishlist for
the next version..."
</p>
        <p>
And as I said there that I have a temporary good solution until we'll have
it in the next SQL Server release (if someone from Microsoft is reading...).
</p>
        <p>
The MdxInjection program takes your common MDX Script and a very simple xml file that
defines where to inject this script. It injects the script into your desired cubes
and even replaces the dimensions' names where necessary (it is relevant where you
put dimension in a cube with a different name to thr dimension or when you use Role
Playing Dimensions). I couldn't hold myself from writing some test code so it's also
included in the project. The project is written in C# 2 using much AMO code. All the
technical little details are inside.
</p>
        <p>
Enjoy.
</p>
        <p>
          <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip">Download
Link</a>
        </p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=aca4f6ce-32bb-47ab-a453-5b23c25b3d48" />
      </body>
      <title>The MdxInjection Program</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</link>
      <pubDate>Sun, 16 Nov 2008 23:29:02 GMT</pubDate>
      <description>&lt;p&gt;
In the &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,f5f76417-9128-4fd7-a8d6-ba60619df30e.aspx"&gt;previous
post&lt;/a&gt; I talked about the DRY principle in the BI Development. I mentioned that
one of the major problems in the principle's implementation is in the common MDX code. &lt;a href="http://cwebbbi.spaces.live.com/"&gt;Chris&lt;/a&gt; Commented:
&lt;/p&gt;
&lt;p&gt;
"I'd like to be able to have a global MDX Script and be able to do something like
a #include to bring calculations into specific cubes. One to add to my wishlist for
the next version..."
&lt;/p&gt;
&lt;p&gt;
And as I said there&amp;nbsp;that&amp;nbsp;I have a temporary good solution until we'll have
it in the next SQL Server release (if someone from Microsoft is reading...).
&lt;/p&gt;
&lt;p&gt;
The MdxInjection program takes your common MDX Script and a very simple xml file that
defines where to inject this script. It injects the script into your desired cubes
and even replaces the dimensions' names where necessary (it is relevant where you
put dimension in a cube with a different name to thr dimension or when you use Role
Playing Dimensions). I couldn't hold myself from writing some test code so it's also
included in the project. The project is written in C# 2 using much AMO code. All the
technical little details are inside.
&lt;/p&gt;
&lt;p&gt;
Enjoy.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip"&gt;Download
Link&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=aca4f6ce-32bb-47ab-a453-5b23c25b3d48" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services;Programming;Programming/.Net</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=f590b1f7-4d99-4539-bf47-349c121fd431</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,f590b1f7-4d99-4539-bf47-349c121fd431.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,f590b1f7-4d99-4539-bf47-349c121fd431.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f590b1f7-4d99-4539-bf47-349c121fd431</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">My friends were stuck with a totally weird
bug this week. After a day of frustration they called me for the rescue. It took me
some time to figure it out and I think that every SSIS developer (and maybe every
developer) can learn a thing or two from others' mistakes.<br /><br /><u>The mission:</u> The data flow takes one table with duplicate rows and copies it
to another table and makes sure that every row will appear only once. In the way,
the data flow also adds some irrelevant fields. Among them is the Create_User and
Create_Date fields which tells by who and when the package last ran.<br /><u>How my friends did it:</u> Again, it's a very simple flow. They only added Derived
Column transformation to add the new fields and then they added an Aggregate transformation
to make every row appear only once. 
<br /><img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationDataFlow.GIF" border="0" /><br />
Note that this is not the real package. It's a sample I did on my machine to show
it here.<br /><br /><u>The Bug:</u> When I first seen this it seemed to me very simple flow and I asked
myself how can it be that this is happening:<br /><img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregation.GIF" border="0" /><img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregation2.GIF" border="0" /><br />
As you can see, it seems that the Aggregate transformation is not deterministic. Sometimes
it outputs 99 rows, sometimes 198 and in some other times I get other results as well.<br /><u>Investigating:</u> I wanted to see what's the difference between the table that
I got in the first time (99 rows) and the table I got in the second time (198 rows)
so I changed the destination table and compared the two tables. I ran "select * from
A where Column1+Column2+... not in (select Column1+Column2+... from B)"-style query
but it was no use - it showed me that there were no rows that appeared only in one
of the tables. In this step I really started to think (as my friends did) that maybe
the Aggregate transformation has something wrong inside... Instead of blaming Microsoft,
I decided to think. I needed to see what can make the flow non-deterministic. Then,
it hit me.<br /><br /><img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationDerivedColumn.GIF" border="0" /><img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationAggregate.GIF" border="0" /><br />
The only non-deterministic component in the flow is the Derived Column because it
has the getdate() function (it may be simple to see here, but in the original package
the derived column transformation had many fields). The results of this function may
differ in the milliseconds, especially for large tables. Then I looked in the Aggregate
transformation and seen that the Create_Date column also was in the Group by operation,
meaning that if two rows has different millisecond they will be placed twice in the
destination table, although they are the same in every column. That's it, the bug
was found. But still, one question remained: Why the query did not show me this? The
answer is also simple but tricky to find: In the comparison query I concatenated all
the columns in the tables in order to compare the results. When I did this, I casted
the Create_Date to nvarchar which truncated the milliseconds. 
<p></p><u>Conclusions:</u><ul><li>
Pay attention to non-deterministic elements in what you do, whether it's code or ETL
process. 
</li><li>
When you do dummy stuff like checking all the checkboxes in a list - think what are
the outcomes. 
</li><li>
Call Miky when you're desperate.</li></ul><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f590b1f7-4d99-4539-bf47-349c121fd431" /></body>
      <title>Non Deterministic Aggregation in SSIS ?</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,f590b1f7-4d99-4539-bf47-349c121fd431.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,f590b1f7-4d99-4539-bf47-349c121fd431.aspx</link>
      <pubDate>Sun, 21 Sep 2008 22:10:48 GMT</pubDate>
      <description>My friends were stuck with a totally weird bug this week. After a day of frustration they called me for the rescue. It took me some time to figure it out and I think that every SSIS developer (and maybe every developer)&amp;nbsp;can learn a thing or two from others' mistakes.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;The mission:&lt;/u&gt; The data flow takes one table with duplicate rows and copies it
to another table and makes sure that every row will appear only once. In the way,
the data flow also adds some irrelevant fields. Among them is the Create_User and
Create_Date fields which tells by who and when the package last ran.&lt;br&gt;
&lt;u&gt;How my friends did it:&lt;/u&gt; Again, it's a very simple flow. They only added Derived
Column transformation to add the new fields and then they added an Aggregate transformation
to make every row appear only once. 
&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationDataFlow.GIF" border=0&gt;
&lt;br&gt;
Note that this is not the real package. It's a sample I did on my machine to show
it here.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;The Bug:&lt;/u&gt; When I first seen this it seemed to me very simple flow and I asked
myself how can it be that this is happening:&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregation.GIF" border=0&gt;&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregation2.GIF" border=0&gt;
&lt;br&gt;
As you can see, it seems that the Aggregate transformation is not deterministic. Sometimes
it outputs 99 rows, sometimes 198 and in some other times I get other results as well.&lt;br&gt;
&lt;u&gt;Investigating:&lt;/u&gt; I wanted to see what's the difference between the table that
I got in the first time (99 rows) and the table I got in the second time (198 rows)
so I changed the destination table and compared the two tables. I ran "select * from
A where Column1+Column2+... not in (select Column1+Column2+... from B)"-style query
but it was no use - it showed me that there were no rows that appeared only in one
of the tables. In this step I really started to think (as my friends did) that maybe
the Aggregate transformation has something wrong inside... Instead of blaming Microsoft,
I decided to think. I needed to see what can make the flow non-deterministic. Then,
it hit me.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationDerivedColumn.GIF" border=0&gt;&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonDeterministicAggregationAggregate.GIF" border=0&gt;
&lt;br&gt;
The only non-deterministic component in the flow is the Derived Column because it
has the getdate() function (it may be simple to see here, but in the original package
the derived column transformation had many fields). The results of this function may
differ in the milliseconds, especially for large tables. Then I looked in the Aggregate
transformation and seen that the Create_Date column also was in the Group by operation,
meaning that if two rows has different millisecond they will be placed twice in the
destination table, although they are the same in every column. That's it, the bug
was found. But still, one question remained: Why the query did not show me this? The
answer is also simple but tricky to find: In the comparison query I concatenated all
the columns in the tables in order to compare the results. When I did this, I casted
the Create_Date to nvarchar which truncated the milliseconds. 
&lt;p&gt;
&lt;/p&gt;
&lt;u&gt;Conclusions:&lt;/u&gt; 
&lt;ul&gt;
&lt;li&gt;
Pay attention to non-deterministic elements in what you do, whether it's code or ETL
process. 
&lt;li&gt;
When you do dummy stuff like checking all the checkboxes in a list - think what are
the outcomes. 
&lt;li&gt;
Call Miky when you're desperate.&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f590b1f7-4d99-4539-bf47-349c121fd431" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,f590b1f7-4d99-4539-bf47-349c121fd431.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services;BI/SQL Server 2008;BI/SQL Server 2008/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=e83c59f6-3548-4bb0-b608-965db296ddd0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,e83c59f6-3548-4bb0-b608-965db296ddd0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,e83c59f6-3548-4bb0-b608-965db296ddd0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e83c59f6-3548-4bb0-b608-965db296ddd0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There is one tiny new feature in SSAS 2008 that you can easily miss. It called Empty
Cube. When you create a new cube using the wizard, you can create an empty cube, meaning
that it has no measures, dimension relationships, etc. The original use of it is for
"users (who) want to create everything manually, or when all dimensions are linked
dimensions" (taken from the description in the wizard)
</p>
        <p>
          <img src="http://www.miky-schreiber.com/Blog/content/binary/emptyCube.jpg" />
        </p>
        <p>
In the past, I <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx">written</a> about
using SSAS with Visual SourceSafe in order to have source and version control for
the SSAS project. I mentioned that it has many disadvantages but the big advantage
(source &amp; version control) is bigger so in the bottom line I recommend using it.
One of the problems we experienced were that every time that someone creates a new
object (cube, dimension, etc.) he has to check out the .dwproj file. The result
is that sometimes we have a fight in the team for that file and we shouting: "who
taken out the dwproj???" (yeah, I know that we can check who did it inside VSS but
shouting is more fun).
</p>
        <p>
The empty cube feature is a nice solution for this problem: When you create a new
project you can create all the (empty) cubes and then the .dwproj file is free and
no longer needed. I'm assuming that you know which cubes you'll have when starting
a new project. The only thing remained is the same solution for dimensions. I'll recommend
it in the Connect site (it's not working now for some reason).
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e83c59f6-3548-4bb0-b608-965db296ddd0" />
      </body>
      <title>Unexpected Use for Empty Cubes</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,e83c59f6-3548-4bb0-b608-965db296ddd0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,e83c59f6-3548-4bb0-b608-965db296ddd0.aspx</link>
      <pubDate>Sun, 17 Aug 2008 17:50:41 GMT</pubDate>
      <description>&lt;p&gt;
There is one tiny new feature in SSAS 2008 that you can easily miss. It called Empty
Cube. When you create a new cube using the wizard, you can create an empty cube, meaning
that it has no measures, dimension relationships, etc. The original use of it is for
"users (who) want to create everything manually, or when all dimensions are linked
dimensions" (taken from the description in the wizard)
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/emptyCube.jpg"&gt;
&lt;/p&gt;
&lt;p&gt;
In the past, I &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx"&gt;written&lt;/a&gt; about
using SSAS with Visual SourceSafe in order to have source and version control for
the SSAS project. I mentioned that it has many disadvantages but the big advantage
(source &amp;amp; version control) is bigger so in the bottom line I recommend using it.
One of the problems we experienced were that every time that someone creates a new
object (cube, dimension, etc.)&amp;nbsp;he has to check out the .dwproj file. The result
is that sometimes we have a fight in the team for that file and we shouting: "who
taken out the dwproj???" (yeah, I know that we can check who did it inside VSS but
shouting is more fun).
&lt;/p&gt;
&lt;p&gt;
The empty cube feature is a nice solution for this problem: When you create a new
project you can create all the (empty) cubes and then the .dwproj file is free and
no longer needed. I'm assuming that you know which cubes you'll have when starting
a new project. The only thing remained is the same solution for dimensions. I'll recommend
it in the Connect site (it's not working now for some reason).
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e83c59f6-3548-4bb0-b608-965db296ddd0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,e83c59f6-3548-4bb0-b608-965db296ddd0.aspx</comments>
      <category>BI;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=0836f43b-3166-4d5c-a1d4-824d226abf91</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,0836f43b-3166-4d5c-a1d4-824d226abf91.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,0836f43b-3166-4d5c-a1d4-824d226abf91.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0836f43b-3166-4d5c-a1d4-824d226abf91</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Found a great site for BI beginners. <a href="http://www.learnmicrosoftbi.com/Default.aspx">Learn
Microsoft BI</a> has some videos about BI and SSAS which can place you in a good position
as a beginner.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0836f43b-3166-4d5c-a1d4-824d226abf91" /></body>
      <title>Learn Microsoft BI</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,0836f43b-3166-4d5c-a1d4-824d226abf91.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,0836f43b-3166-4d5c-a1d4-824d226abf91.aspx</link>
      <pubDate>Tue, 12 Aug 2008 11:36:52 GMT</pubDate>
      <description>Found a great site for BI beginners. &lt;a href="http://www.learnmicrosoftbi.com/Default.aspx"&gt;Learn
Microsoft BI&lt;/a&gt; has some videos about BI and SSAS which can place you in a good position
as a beginner.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0836f43b-3166-4d5c-a1d4-824d226abf91" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,0836f43b-3166-4d5c-a1d4-824d226abf91.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a53efa89-7232-4d27-b27e-0e3174beeaf0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a53efa89-7232-4d27-b27e-0e3174beeaf0</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <b>
          <i>
            <u>update:</u>
          </i>
        </b> Chris Webb
and Mosha commented and made it clear that the reason for this error wrap is the NonEmptyCrossJoin
function and nothing else. I also checked and I did not find any other function that
wraps underlying errors.<br /><br />
This is something you need to be aware of when you're writing MDX. I don't know whether
it's a bug or by-design. I'll be happy 
<br />
to know (please comment if you know something that I don't).<br />
Consider the following MDX:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">SELECT </span><br />
  <span style="color: blue;">NonEmptyCrossJoin</span><br />
  (<br />
    [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
   ,[Employee].[Employee Department].[Department].&amp;[Sales]<br />
  ) ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];<br /><br /></span></span>The query will return with this error:<span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> The
Set_Count argument of the NonEmptyCrossJoin function is either negative or larger
than the number of sets provided. </span></span>This is quite reasonable because I
written the second argument as a member, where (NonEmpty)CrossJoin expects only sets.
So, let's upgrade this member to a set:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">SELECT </span><br />
  <span style="color: blue;">NonEmptyCrossJoin</span><br />
  (<br />
    [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
   ,{[Employee].[Employee Department].[Department].&amp;[Sales]}<br />
  ) ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
All I did is wrapping the second argument with {} and we have a set. The query will
return 19 columns.<br />
Now, for the interesting part. Let's count the members of this CrossJoin before the
we fix it:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">WITH </span><br />
  <span style="color: blue;">MEMBER</span> [a] <span style="color: blue;">AS</span><br />
    <span style="color: blue;">NonEmptyCrossJoin</span><br />
    (<br />
      [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
     ,[Employee].[Employee Department].[Department].&amp;[Sales]<br />
    ).<span style="color: blue;">Count</span><br /><span style="color: blue;">SELECT </span><br />
  [a] ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
This return... 0.                <img src="http://www.miky-schreiber.com/Blog/content/binary/mdxZero.JPG" border="0" /><br /><b>Where is the error?</b><br />
My guess is that the Count function wraps the error. The NonEmptyCrossJoin returns
null and the count of members in null is zero. The meaning of this is that if you'll
ever forget to wrap the member with {} you'll always get zero and not an error. This
can be very dangerous. Just for the check, running this query after the fix:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">WITH </span><br />
  <span style="color: blue;">MEMBER</span> [a] <span style="color: blue;">AS</span><br />
    <span style="color: blue;">NonEmptyCrossJoin</span><br />
    (<br />
      [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
     ,{[Employee].[Employee Department].[Department].&amp;[Sales]}<br />
    ).<span style="color: blue;">Count</span><br /><span style="color: blue;">SELECT </span><br />
  [a] ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
will return 19. This been tested with both SSAS 2005 and 2008 (RC0). The examples
here are from RC0.<br /><br />
Be careful with your MDX.<br /><br /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a53efa89-7232-4d27-b27e-0e3174beeaf0" /></body>
      <title>Error Wrap in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</link>
      <pubDate>Sun, 03 Aug 2008 19:28:26 GMT</pubDate>
      <description>&lt;b&gt;&lt;i&gt;&lt;u&gt;update:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; Chris Webb and Mosha commented and made it clear that
the reason for this error wrap is the NonEmptyCrossJoin function and nothing else.
I also checked and I did not find any other function that wraps underlying errors.&lt;br&gt;
&lt;br&gt;
This is something you need to be aware of when you're writing MDX. I don't know whether
it's a bug or by-design. I'll be happy 
&lt;br&gt;
to know (please comment if you know something that I don't).&lt;br&gt;
Consider the following MDX:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;,[Employee].[Employee Department].[Department].&amp;amp;[Sales]&lt;br&gt;
&amp;nbsp;&amp;nbsp;) ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;The query will return with this error:&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; The
Set_Count argument of the NonEmptyCrossJoin function is either negative or larger
than the number of sets provided. &lt;/span&gt;&lt;/span&gt;This is quite reasonable because I
written the second argument as a member, where (NonEmpty)CrossJoin expects only sets.
So, let's upgrade this member to a set:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;,{[Employee].[Employee Department].[Department].&amp;amp;[Sales]}&lt;br&gt;
&amp;nbsp;&amp;nbsp;) ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
All I did is wrapping the second argument with {} and we have a set. The query will
return 19 columns.&lt;br&gt;
Now, for the interesting part. Let's count the members of this CrossJoin before the
we fix it:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;MEMBER&lt;/span&gt; [a] &lt;span style="color: blue;"&gt;AS&lt;/span&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,[Employee].[Employee Department].[Department].&amp;amp;[Sales]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;).&lt;span style="color: blue;"&gt;Count&lt;/span&gt; 
&lt;br&gt;
&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;[a] ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
This return... 0.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img src="http://www.miky-schreiber.com/Blog/content/binary/mdxZero.JPG" border="0"&gt;
&lt;br&gt;
&lt;b&gt;Where is the error?&lt;/b&gt;
&lt;br&gt;
My guess is that the Count function wraps the error. The NonEmptyCrossJoin returns
null and the count of members in null is zero. The meaning of this is that if you'll
ever forget to wrap the member with {} you'll always get zero and not an error. This
can be very dangerous. Just for the check, running this query after the fix:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;MEMBER&lt;/span&gt; [a] &lt;span style="color: blue;"&gt;AS&lt;/span&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,{[Employee].[Employee Department].[Department].&amp;amp;[Sales]}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;).&lt;span style="color: blue;"&gt;Count&lt;/span&gt; 
&lt;br&gt;
&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;[a] ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
will return 19. This been tested with both SSAS 2005 and 2008 (RC0). The examples
here are from RC0.&lt;br&gt;
&lt;br&gt;
Be careful with your MDX.&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a53efa89-7232-4d27-b27e-0e3174beeaf0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=cf4f07c4-447b-4b79-8a70-4fe40f5033c1</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,cf4f07c4-447b-4b79-8a70-4fe40f5033c1.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,cf4f07c4-447b-4b79-8a70-4fe40f5033c1.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=cf4f07c4-447b-4b79-8a70-4fe40f5033c1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">When you practice on SQL Server on your
local machine you don't want that its services will start up with the computer. As
I mentioned before, you should declare the startup method of these services as manual
(see <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx">here</a>).
After that, you can build two simple batch files that will start and stop the services.
Believe me - it's very comfotable to start and stop the services with only one mouse
click. The first batch file (I called it sql.bat) contains only two lines:<br /><br />
net start MSSQLSERVER<br />
net start MSSqlServerOLAPService<br /><br />
The second one (sqlend.bat) looks like that:<br /><br />
net stop MSSQLSERVER<br />
net stop MSSqlServerOLAPService<br /><br />
Note that I only start/stop the SQL Server and analysis services, but you can do whatever
you like.<br /><br />
Have fun.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=cf4f07c4-447b-4b79-8a70-4fe40f5033c1" /></body>
      <title>Manually Starting the SQL Server Services on your Machine</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,cf4f07c4-447b-4b79-8a70-4fe40f5033c1.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,cf4f07c4-447b-4b79-8a70-4fe40f5033c1.aspx</link>
      <pubDate>Wed, 23 Jul 2008 19:19:08 GMT</pubDate>
      <description>When you practice on SQL Server on your local machine you don't want that its services will start up with the computer. As I mentioned before, you should declare the startup method of these services as manual (see &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx"&gt;here&lt;/a&gt;).
After that, you can build two simple batch files that will start and stop the services.
Believe me - it's very comfotable to start and stop the services with only one mouse
click. The first batch file (I called it sql.bat) contains only two lines:&lt;br&gt;
&lt;br&gt;
net start MSSQLSERVER&lt;br&gt;
net start MSSqlServerOLAPService&lt;br&gt;
&lt;br&gt;
The second one (sqlend.bat) looks like that:&lt;br&gt;
&lt;br&gt;
net stop MSSQLSERVER&lt;br&gt;
net stop MSSqlServerOLAPService&lt;br&gt;
&lt;br&gt;
Note that I only start/stop the SQL Server and analysis services, but you can do whatever
you like.&lt;br&gt;
&lt;br&gt;
Have fun.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=cf4f07c4-447b-4b79-8a70-4fe40f5033c1" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,cf4f07c4-447b-4b79-8a70-4fe40f5033c1.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008;Tips &amp; Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=1e53bd53-42d2-42ef-aeed-dc69c6c12a2c</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,1e53bd53-42d2-42ef-aeed-dc69c6c12a2c.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,1e53bd53-42d2-42ef-aeed-dc69c6c12a2c.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1e53bd53-42d2-42ef-aeed-dc69c6c12a2c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Sometimes the uninstall process does not
succeed or even worse - the "Add or Remove programs" interface does not allow you
to uninstall the product because it already uninstalled / doesn't exist / you name
it. The problem is that the uninstalled program can't be removed from the list, it
can't be uninstalled and it prevents another installation or re-installation. This
happens a lot with Microsoft's heavy products such as SQL Server and Visual Studio
but it can also happen with other products too.<br />
What can you do?<p>
Here's a small tip: Open the registry editor (Start -&gt; Run -&gt; regedit) and go
to the path: My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.<br />
Under this folder you'll see many folders with GUI names such as {1268CDD4-0FED-3CE6-8A9D-C3B012ABCD8F}.
To know what installation it is, look for the key named DisplayName under this GUI
folder. In most of these folders you'll see a key named UninstallString. To uninstall
this program, copy the value of UninstallString and paste it in the run dialog. This
will start the uninstall process.<br /><br />
This trick will not always work, but it can help you a lot. Especially with broken
installation of SQL Server.<br /><br />
Enjoy.<br /></p><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=1e53bd53-42d2-42ef-aeed-dc69c6c12a2c" /></body>
      <title>When Uninstall is not enough</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,1e53bd53-42d2-42ef-aeed-dc69c6c12a2c.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,1e53bd53-42d2-42ef-aeed-dc69c6c12a2c.aspx</link>
      <pubDate>Sun, 20 Jul 2008 20:24:27 GMT</pubDate>
      <description>Sometimes the uninstall process does not succeed or even worse - the "Add or Remove programs" interface does not allow you to uninstall the product because it already uninstalled / doesn't exist / you name it. The problem is that the uninstalled program can't be removed from the list, it can't be uninstalled and it prevents another installation or re-installation. This happens a lot with Microsoft's heavy products such as SQL Server and Visual Studio but it can also happen with other products too.&lt;br&gt;
What can you do?&lt;p&gt;
Here's a small tip: Open the registry editor (Start -&amp;gt; Run -&amp;gt; regedit) and go
to the path: My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.&lt;br&gt;
Under this folder you'll see many folders with GUI names such as {1268CDD4-0FED-3CE6-8A9D-C3B012ABCD8F}.
To know what installation it is, look for the key named DisplayName under this GUI
folder. In most of these folders you'll see a key named UninstallString. To uninstall
this program, copy the value of UninstallString and paste it in the run dialog. This
will start the uninstall process.&lt;br&gt;
&lt;br&gt;
This trick will not always work, but it can help you a lot. Especially with broken
installation of SQL Server.&lt;br&gt;
&lt;br&gt;
Enjoy.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=1e53bd53-42d2-42ef-aeed-dc69c6c12a2c" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,1e53bd53-42d2-42ef-aeed-dc69c6c12a2c.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008;Tips &amp; Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=bd3b4879-d5f8-45d5-81b2-b5cb6814d705</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,bd3b4879-d5f8-45d5-81b2-b5cb6814d705.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,bd3b4879-d5f8-45d5-81b2-b5cb6814d705.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bd3b4879-d5f8-45d5-81b2-b5cb6814d705</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">One more tip about installing the database
samples: I believe that installing them is not enough. In order to improve your skills
you need to have a deep knowledge of them. Therefore, don't deploy the SSAS project
to the server and that's it. Build it yourself. Yes - create a new project called
MyAdventureWorks or something like that and build all the objects by yourself. Indeed,
this will take time and strength but this is worth this. After you'll do all the tricky
things yourself then you really got it in hands. Learn the AW project and be a master.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=bd3b4879-d5f8-45d5-81b2-b5cb6814d705" /></body>
      <title>Getting Familiar with Adventure Works</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,bd3b4879-d5f8-45d5-81b2-b5cb6814d705.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,bd3b4879-d5f8-45d5-81b2-b5cb6814d705.aspx</link>
      <pubDate>Sun, 25 May 2008 21:44:47 GMT</pubDate>
      <description>One more tip about installing the database samples: I believe that installing them is not enough. In order to improve your skills you need to have a deep knowledge of them. Therefore, don't deploy the SSAS project to the server and that's it. Build it yourself. Yes - create a new project called MyAdventureWorks or something like that and build all the objects by yourself. Indeed, this will take time and strength but this is worth this. After you'll do all the tricky things yourself then you really got it in hands. Learn the AW project and be a master.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=bd3b4879-d5f8-45d5-81b2-b5cb6814d705" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,bd3b4879-d5f8-45d5-81b2-b5cb6814d705.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=ee8e2951-09b7-4d07-9819-0535348c28e7</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ee8e2951-09b7-4d07-9819-0535348c28e7</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I thought that it will be a simple next,next,next
installation, but it turned out that it is more complex than I thought. It is not
something very hard to do, but there are some tricky points, especially when installing
it on my PC and not on a dedicated strong server.<br />
The installation starts as a simple wizard. Just go on with it but pay attention to
this screen:<br /><p></p><img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst.JPG" border="0" /><br /><br />
Here, you need to specify account for every service installed. Because it is a CTP
installation and not a real server installation, you can make easy life for yourself
and just use an administrator account for all the services because security is not
an issue now. In the bottom of the screen, enter account and password of an administrator
account and click on "Apply to all".<br />
Now, for the really important note - the startup type. There are three startup types
in windows services:<br /><ol><li>
Automatic - The service will wake up with the operation system.</li><li>
Manual - The service will start only by a process or an admin user.</li><li>
Disabled - The service can't start at all.</li></ol>
This choice is very important. If you're making the installation on a dedicated machine
then you can choose Automatic because you'll need the service to be always running.
But - if you installing this on a personal computer then you don't want these CPU
&amp; memory consuming services to be up all time long. In this case you need to choose
Manual and start these services only when you need them. When you do, you start them
by typing "services.msc" in the Start -&gt; Run dialog and then find the service and
click on start. I don't see any reason the choose the Disabled startup type in this
screen. By the way, there's a new type in Vista called "Delayed", which starts the
process only after the Automatic ones have been started. This option doesn't exist
here and I don't see any reason to use it anyway.<br /><br />
Now for the big problem - installing the sample databases. The samples are not a part
of the CTP so you'll need to download them from <a href="http://www.codeplex.com/MSFTDBProdSamples">codeplex</a>. <b>Make
sure</b> that you download the samples that fit your CTP version. If you don't have
the latest CTP then don't download the latest samples. Find your version in the <a href="http://www.codeplex.com/MSFTDBProdSamples/SourceControl/ListDownloadableCommits.aspx">releases
section</a>. After you have downloaded your samples, start the wizard. When you get
to this screen:<br /><br /><img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst2.JPG" border="0" /><br />
you'll get stuck (if you haven't read this first, of course) with this message:<br /><img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst3.JPG" border="0" /><br />
Error 27502. Could not connect to Microsoft SQL Server '(local)'. [DBNETLIB][ConnectionOpen
(Connect()). SQL Server does not exist or access denied. (17) <i>[I copied that for
the ones who will find this by google search]<br /><br /></i>It got me a while to resolve this, so this is what you need to do <b>before</b> you
install the samples:<br />
Open the SQL Configuration manager (Start -&gt; Programs -&gt; Microsoft SQL Server
2008 -&gt; Configuration tools) and enable TCP/IP protocal in the server:<br /><img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst4.JPG" border="0" /><br /><br />
That should solve it. After that, go to the directory "c:\Program Files\Microsoft
SQL Server\100\Tools\Samples" and there you'll find the samples with a document that
explain how to attach them to the server.<br /><br />
I hope this is helpful to those who got stuck and those who haven't got stuck with
it yet. Enjoy.<br /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=ee8e2951-09b7-4d07-9819-0535348c28e7" /></body>
      <title>Installing SQL Server 2008 CTP</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx</link>
      <pubDate>Sat, 24 May 2008 21:33:43 GMT</pubDate>
      <description>I thought that it will be a simple next,next,next installation, but it turned out that it is more complex than I thought. It is not something very hard to do, but there are some tricky points, especially when installing it on my PC and not on a dedicated strong server.&lt;br&gt;
The installation starts as a simple wizard. Just go on with it but pay attention to
this screen:&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst.JPG" border="0" &gt;
&lt;br&gt;
&lt;br&gt;
Here, you need to specify account for every service installed. Because it is a CTP
installation and not a real server installation, you can make easy life for yourself
and just use an administrator account for all the services because security is not
an issue now. In the bottom of the screen, enter account and password of an administrator
account and click on "Apply to all".&lt;br&gt;
Now, for the really important note - the startup type. There are three startup types
in windows services:&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Automatic - The service will wake up with the operation system.&lt;/li&gt;
&lt;li&gt;
Manual - The service will start only by a process or an admin user.&lt;/li&gt;
&lt;li&gt;
Disabled - The service can't start at all.&lt;/li&gt;
&lt;/ol&gt;
This choice is very important. If you're making the installation on a dedicated machine
then you can choose Automatic because you'll need the service to be always running.
But - if you installing this on a personal computer then you don't want these CPU
&amp;amp; memory consuming services to be up all time long. In this case you need to choose
Manual and start these services only when you need them. When you do, you start them
by typing "services.msc" in the Start -&amp;gt; Run dialog and then find the service and
click on start. I don't see any reason the choose the Disabled startup type in this
screen. By the way, there's a new type in Vista called "Delayed", which starts the
process only after the Automatic ones have been started. This option doesn't exist
here and I don't see any reason to use it anyway.&lt;br&gt;
&lt;br&gt;
Now for the big problem - installing the sample databases. The samples are not a part
of the CTP so you'll need to download them from &lt;a href="http://www.codeplex.com/MSFTDBProdSamples"&gt;codeplex&lt;/a&gt;. &lt;b&gt;Make
sure&lt;/b&gt; that you download the samples that fit your CTP version. If you don't have
the latest CTP then don't download the latest samples. Find your version in the &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/SourceControl/ListDownloadableCommits.aspx"&gt;releases
section&lt;/a&gt;. After you have downloaded your samples, start the wizard. When you get
to this screen:&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst2.JPG" border="0"&gt;
&lt;br&gt;
you'll get stuck (if you haven't read this first, of course) with this message:&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst3.JPG" border="0"&gt;
&lt;br&gt;
Error 27502. Could not connect to Microsoft SQL Server '(local)'. [DBNETLIB][ConnectionOpen
(Connect()). SQL Server does not exist or access denied. (17) &lt;i&gt;[I copied that for
the ones who will find this by google search]&lt;br&gt;
&lt;br&gt;
&lt;/i&gt;It got me a while to resolve this, so this is what you need to do &lt;b&gt;before&lt;/b&gt; you
install the samples:&lt;br&gt;
Open the SQL Configuration manager (Start -&amp;gt; Programs -&amp;gt; Microsoft SQL Server
2008 -&amp;gt; Configuration tools) and enable TCP/IP protocal in the server:&lt;br&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/ssasctpinst4.JPG" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
That should solve it. After that, go to the directory "c:\Program Files\Microsoft
SQL Server\100\Tools\Samples" and there you'll find the samples with a document that
explain how to attach them to the server.&lt;br&gt;
&lt;br&gt;
I hope this is helpful to those who got stuck and those who haven't got stuck with
it yet. Enjoy.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=ee8e2951-09b7-4d07-9819-0535348c28e7" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,ee8e2951-09b7-4d07-9819-0535348c28e7.aspx</comments>
      <category>BI;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=c2148820-1e7d-47f2-bfea-ba50fdd639d1</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c2148820-1e7d-47f2-bfea-ba50fdd639d1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I started a long <font color="#0000ff"><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3197183&amp;SiteID=1">conversation</a></font> about
this subject in the <font color="#0000ff"><a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=83&amp;SiteID=1">MDSN
SSAS forum</a></font>. I think that it's a question and a principal that every advanced
MDX programmer should be familiar with.<br /><br />
It all started with a customer that needed a standard deviation aggregation. I thought
that it would be simple because there's a <a href="http://msdn.microsoft.com/en-us/library/ms146034.aspx">StdDev
function</a> in MDX, but it turned out that my customer had major plans for me: He
wanted this aggregation to act for every dimension he puts on his axis. This means
that the aggregation is not defined over a specific dimension (such as date), but
the std-dev is defined over the current dimension in the axis.<br /><br />
The solution for this problem consists of a principle and an answer.<br /><br /><u>The Principle<br /></u>Aggregation or a measure that is based on the current user's query is bad. This
can and will result two users to see different results using the same measure. This
will cause confusion and disinformation. The sacred principle of One Truth will be
desecrated. Taken from the thread, in <a href="http://cwebbbi.spaces.live.com">Chris
Webb</a>'s words:<br /><br />
"<i><span id="_ctl0_MainContent_PostFlatView"><span>I quite often see people wanting
to write calculations that behave differently depending on the query that's being
run, and I always tell them not to do it. You can hack something but it's almost impossible
to get it work properly for every single possible query - MDX just doesn't work like
that</span></span></i>"<br /><br />
In the end I explained that to the user and he agreed. One more reason for his approval
is that std-dev often doesn't really says something about the data. In other words,
it isn't informative. "The standard deviation is 0.432. That means that... ???"<br /><p></p><br /><u>The Answer</u><br />
If you (or the customer) still insists on that crazy measure, the following MDX will
work.<br /><br /><div><font face="Courier">With<br />
Member <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>RowSTDOrders<font color="Blue">]</font> <font color="Blue">as</font><br />
iif<font color="Blue">(</font>Count<font color="Blue">(</font>NonEmpty<font color="Blue">(</font>StrToSet<font color="Blue">(</font><font color="Maroon">"Axis(1)"</font><font color="Blue">)</font><font color="Blue">.</font>Item<font color="Blue">(</font><font color="Maroon">0</font><font color="Blue">)</font><font color="Blue">.</font>Hierarchy<font color="Blue">.</font>Children, 
<br /><font color="Blue">{</font><font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Order Quantity<font color="Blue">]</font><font color="Blue">}</font><font color="Blue">)</font> <font color="Blue">as</font> ChildSet<font color="Blue">)</font> &lt; <font color="Maroon">2</font>, 
<br />
Null, 
<br />
StDev<font color="Blue">(</font>ChildSet, <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Order Quantity<font color="Blue">]</font><font color="Blue">)</font><font color="Blue">)<br /></font> <br />
select 
<br /><font color="Blue">[</font>Date<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Calendar Year<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Calendar Year<font color="Blue">]</font> on <font color="Maroon">0</font>, 
<br />
Non Empty <font color="Blue">[</font>Product<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Product Categories<font color="Blue">]</font><font color="Blue">.</font>Members on <font color="Maroon">1</font><br />
from <font color="Blue">[</font>Adventure Works<font color="Blue">]</font><br />
where <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>RowSTDOrders<font color="Blue">]<br /><br /></font></font>Thanks for Deepak Puri for this code. Notice that the StrToSet function
will cause performance degrade, but this is the only way that the code will also work
in MDX script and not only in queries.<br /><br />
P.S<br />
It doesn't matter if you write StDev or StdDev.<br /></div><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c2148820-1e7d-47f2-bfea-ba50fdd639d1" /></body>
      <title>Very Customed Aggregation</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</link>
      <pubDate>Tue, 13 May 2008 20:28:38 GMT</pubDate>
      <description>I started a long &lt;font color="#0000ff"&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3197183&amp;amp;SiteID=1"&gt;conversation&lt;/a&gt;&lt;/font&gt; about
this subject in the &lt;font color="#0000ff"&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=83&amp;amp;SiteID=1"&gt;MDSN
SSAS forum&lt;/a&gt;&lt;/font&gt;. I think that it's a question and a principal that every advanced
MDX programmer should be familiar with.&lt;br&gt;
&lt;br&gt;
It all started with a customer that needed a standard deviation aggregation. I thought
that it would be simple because there's a &lt;a href="http://msdn.microsoft.com/en-us/library/ms146034.aspx"&gt;StdDev
function&lt;/a&gt; in MDX, but it turned out that my customer had major plans for me: He
wanted this aggregation to act for every dimension he puts on his axis. This means
that the aggregation is not defined over a specific dimension (such as date), but
the std-dev is defined over the current dimension in the axis.&lt;br&gt;
&lt;br&gt;
The solution for this problem consists of a principle and an answer.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;The Principle&lt;br&gt;
&lt;/u&gt;Aggregation or a measure that is based on the current user's query is bad. This
can and will result two users to see different results using the same measure. This
will cause confusion and disinformation. The sacred principle of One Truth will be
desecrated. Taken from the thread, in &lt;a href="http://cwebbbi.spaces.live.com"&gt;Chris
Webb&lt;/a&gt;'s words:&lt;br&gt;
&lt;br&gt;
"&lt;i&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;I quite often see people wanting
to write calculations that behave differently depending on the query that's being
run, and I always tell them not to do it. You can hack something but it's almost impossible
to get it work properly for every single possible query - MDX just doesn't work like
that&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;"&lt;br&gt;
&lt;br&gt;
In the end I explained that to the user and he agreed. One more reason for his approval
is that std-dev often doesn't really says something about the data. In other words,
it isn't informative. "The standard deviation is 0.432. That means that... ???"&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;u&gt;The Answer&lt;/u&gt;
&lt;br&gt;
If you (or the customer) still insists on that crazy measure, the following MDX will
work.&lt;br&gt;
&lt;br&gt;
&lt;div&gt;&lt;font face="Courier"&gt;With&lt;br&gt;
Member&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;RowSTDOrders&lt;font color="Blue"&gt;]&lt;/font&gt;&amp;nbsp;&lt;font color="Blue"&gt;as&lt;/font&gt; 
&lt;br&gt;
iif&lt;font color="Blue"&gt;(&lt;/font&gt;Count&lt;font color="Blue"&gt;(&lt;/font&gt;NonEmpty&lt;font color="Blue"&gt;(&lt;/font&gt;StrToSet&lt;font color="Blue"&gt;(&lt;/font&gt;&lt;font color="Maroon"&gt;"Axis(1)"&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Item&lt;font color="Blue"&gt;(&lt;/font&gt;&lt;font color="Maroon"&gt;0&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Hierarchy&lt;font color="Blue"&gt;.&lt;/font&gt;Children, 
&lt;br&gt;
&lt;font color="Blue"&gt;{&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Order&amp;nbsp;Quantity&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;}&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&amp;nbsp;&lt;font color="Blue"&gt;as&lt;/font&gt;&amp;nbsp;ChildSet&lt;font color="Blue"&gt;)&lt;/font&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;font color="Maroon"&gt;2&lt;/font&gt;, 
&lt;br&gt;
Null, 
&lt;br&gt;
StDev&lt;font color="Blue"&gt;(&lt;/font&gt;ChildSet,&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Order&amp;nbsp;Quantity&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&lt;br&gt;
select 
&lt;br&gt;
&lt;font color="Blue"&gt;[&lt;/font&gt;Date&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Calendar&amp;nbsp;Year&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Calendar&amp;nbsp;Year&lt;font color="Blue"&gt;]&lt;/font&gt;&amp;nbsp;on&amp;nbsp;&lt;font color="Maroon"&gt;0&lt;/font&gt;, 
&lt;br&gt;
Non&amp;nbsp;Empty&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Product&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Product&amp;nbsp;Categories&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Members&amp;nbsp;on&amp;nbsp;&lt;font color="Maroon"&gt;1&lt;/font&gt; 
&lt;br&gt;
from&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Adventure&amp;nbsp;Works&lt;font color="Blue"&gt;]&lt;/font&gt; 
&lt;br&gt;
where&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;RowSTDOrders&lt;font color="Blue"&gt;]&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;Thanks for Deepak Puri for this code. Notice that the StrToSet function
will cause performance degrade, but this is the only way that the code will also work
in MDX script and not only in queries.&lt;br&gt;
&lt;br&gt;
P.S&lt;br&gt;
It doesn't matter if you write StDev or StdDev.&lt;br&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c2148820-1e7d-47f2-bfea-ba50fdd639d1" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=01c86eba-f351-463e-a796-feffea5898fe</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,01c86eba-f351-463e-a796-feffea5898fe.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,01c86eba-f351-463e-a796-feffea5898fe.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=01c86eba-f351-463e-a796-feffea5898fe</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">This tiny thing cost me a minute today,
but it may take longer time to some of you, so I'm writing this.<br /><br />
As some of you know, in order to sort a dimension's attribute you need to change to
OrderBy property of the attribute. You can make the attribute to be sorted according
to other attribute (it's a very common thing in SSAS). In order to do so, you set
the OrderBy property to AttributeKey and in the OrderByAttribute property you pick
up the desired attribute (the one you want to define the order).<br /><br /><b>Note that</b> if the first attribute (the one you want to sort) doesn't have attribute-relationship
to the second attribute, you won't be able to pick up the second attribute in the
OrderByAttribute property. These properties must have an attribute-relationship.<br />
One more thing: You don't have to show the end-user the attribute which defines the
order. If you want to hide it just set the property AttributeHierarchyVisible to false.
It is a common pattern to make an attribute which will sort another attribute and
hide it from the user.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=01c86eba-f351-463e-a796-feffea5898fe" /></body>
      <title>Little note about sorting a dimension</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,01c86eba-f351-463e-a796-feffea5898fe.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,01c86eba-f351-463e-a796-feffea5898fe.aspx</link>
      <pubDate>Wed, 07 May 2008 21:32:59 GMT</pubDate>
      <description>This tiny thing cost me a minute today, but it may take longer time to some of you, so I'm writing this.&lt;br&gt;
&lt;br&gt;
As some of you know, in order to sort a dimension's attribute you need to change to
OrderBy property of the attribute. You can make the attribute to be sorted according
to other attribute (it's a very common thing in SSAS). In order to do so, you set
the OrderBy property to AttributeKey and in the OrderByAttribute property you pick
up the desired attribute (the one you want to define the order).&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Note that&lt;/b&gt; if the first attribute (the one you want to sort) doesn't have attribute-relationship
to the second attribute, you won't be able to pick up the second attribute in the
OrderByAttribute property. These properties must have an attribute-relationship.&lt;br&gt;
One more thing: You don't have to show the end-user the attribute which defines the
order. If you want to hide it just set the property AttributeHierarchyVisible to false.
It is a common pattern to make an attribute which will sort another attribute and
hide it from the user.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=01c86eba-f351-463e-a796-feffea5898fe" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,01c86eba-f351-463e-a796-feffea5898fe.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=40de294b-84e7-4d53-bc33-fd023e9a514f</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,40de294b-84e7-4d53-bc33-fd023e9a514f.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,40de294b-84e7-4d53-bc33-fd023e9a514f.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=40de294b-84e7-4d53-bc33-fd023e9a514f</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">We got many client requests for the ability
to show in their web sites the "last updated" date of the data.<br />
It doesn't matter how you show the data of the SSAS - the customers will always want
to know for which date the data is true.<br />
My solution includes a ASP.NET 2.0 web site that uses the AMO class libary. It takes
the date from the server and shows it to the user.<br /><br />
What you need to do is:<br />
1. Open a new ASP.NET web site using Visual Studio 2005/8.<br />
2. Add the AMO dll (Microsoft.Analysis Services). You'll find it in the SSAS server.<br />
3. In the already-made default.aspx page, just add one Label.<br />
4. Add a configuration file which will hold the name of the SSAS server. That way,
when you install the site from the development environment to the production environment,
you'll only have to change this file. Call this file config.xml and write in it the
following:<br />
&lt;?xml version="1.0" encoding="utf-8" ?&gt;<br />
&lt;ServerName&gt;YourServerFullNameHere&lt;/ServerName&gt;<br /><br />
5. In the code-behind file (default.aspx.cs) write the following code instead of what
you already have there:<br /><br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using AMO = Microsoft.AnalysisServices;<br />
using System.Xml;<br /><br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
  protected void Load_Page(Object sender, EventArgs e)<br />
  {<br />
    Label1.Text = GetCubeUpdateDate(Request.QueryString["DBName"],Request.QueryString["CubeId"]);<br />
  }<br /><br />
  private string GetCubeUpdateDate (string dbName, string cubeId)<br />
  {<br />
    using (AMO.Server asServer = new AMO.Server())<br />
    {<br />
      asServer.Connect("Data Source=" + GetAnalysisServerName());<br />
      AMO.Database db = asServer.DataBases.FindByName(dbName);<br />
      if (db == null)<br />
      {<br />
        return "DB Name not found";<br />
      }<br /><br />
      AMO.Cube cube = GetCubeById(cubeId, db);<br />
      if (cube == null)<br />
      {<br />
        return "Cube Name not found";<br />
      }<br /><br />
      DateTime lastProcessed = cube.LastProcessed;<br />
      return lastProcessed.Day.ToString() + "/" + lastProcessed.Month.ToString()
+ "/" + lastProcessed.Year.ToString();<br />
    }<br />
  }<br /><br />
  private string GetAnalysisServerName ()<br />
  {<br />
    XmlDocument xmlDoc = new XmlDocument();<br />
    xmlDoc.Load(Request.PhysicalApplicationPath + "config.xml");<br />
    return xmlDoc.GetElementsByTagName("ServerName").Item(0).InnetText;<br />
  }<br /><br />
  private AMO.Cube GetCubeById (string cubeId, AMO.Database db)<br />
  {<br />
    foreach (AMO.Cube cube in db.Cubes)<br />
    {<br />
      if (cube.ID.Equals(cubeId))<br />
      {<br />
        return cube;<br />
      }<br />
    }<br />
    return null;<br />
  }<br />
}<br /><br />
Eventhough the code is self-explained, here are some points referring it:<br /><ul><li>
I chose not to include the server name in the web.config file because I like to seperate
application-related configuration and web configuration.</li><li>
If you want you can get the cube name from the user (in the query string) and then
the code is even shorter - just get the cube like I got the database.</li><li>
I wanted to show the date in the format DD/MM/YYYY, so that's why I did the long return
statement in the GetCubeUpdateDate method. If you want to return the date in the MM/DD/YYYY
format you can use the lastProcessed.GetShortDateFormat() method.</li><li>
Note that when you publish the web site you need to create a dedicated virtual folder
in the IIS.</li><li>
The user uses this site in the following way: All he need to do is to create a frame
with this site's address as its source and add it the DBName &amp; CubeId in the query
string. In SharePoint it's even easier - the uses only need to create a page shower
web part.</li></ul>
enjoy.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=40de294b-84e7-4d53-bc33-fd023e9a514f" /></body>
      <title>How To Show the Last Update Date of the SSAS Cube</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,40de294b-84e7-4d53-bc33-fd023e9a514f.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,40de294b-84e7-4d53-bc33-fd023e9a514f.aspx</link>
      <pubDate>Mon, 31 Mar 2008 13:05:20 GMT</pubDate>
      <description>We got many client requests for the ability to show in their web sites the "last updated" date of the data.&lt;br&gt;
It doesn't matter how you show the data of the SSAS - the customers will always want
to know for which date the data is true.&lt;br&gt;
My solution includes a ASP.NET 2.0 web site that uses the AMO class libary. It takes
the date from the server and shows it to the user.&lt;br&gt;
&lt;br&gt;
What you need to do is:&lt;br&gt;
1. Open a new ASP.NET web site using Visual Studio 2005/8.&lt;br&gt;
2. Add the AMO dll (Microsoft.Analysis Services). You'll find it in the SSAS server.&lt;br&gt;
3. In the already-made default.aspx page, just add one Label.&lt;br&gt;
4. Add a configuration file which will hold the name of the SSAS server. That way,
when you install the site from the development environment to the production environment,
you'll only have to change this file. Call this file config.xml and write in it the
following:&lt;br&gt;
&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br&gt;
&amp;lt;ServerName&amp;gt;YourServerFullNameHere&amp;lt;/ServerName&amp;gt;&lt;br&gt;
&lt;br&gt;
5. In the code-behind file (default.aspx.cs) write the following code instead of what
you already have there:&lt;br&gt;
&lt;br&gt;
using System;&lt;br&gt;
using System.Data;&lt;br&gt;
using System.Configuration;&lt;br&gt;
using System.Web;&lt;br&gt;
using System.Web.UI;&lt;br&gt;
using System.Web.UI.WebControls;&lt;br&gt;
using System.Web.UI.WebControls.WebParts;&lt;br&gt;
using System.Web.UI.HtmlControls;&lt;br&gt;
using AMO = Microsoft.AnalysisServices;&lt;br&gt;
using System.Xml;&lt;br&gt;
&lt;br&gt;
public partial class _Default : System.Web.UI.Page&lt;br&gt;
{&lt;br&gt;
&amp;nbsp; protected void Load_Page(Object sender, EventArgs e)&lt;br&gt;
&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Label1.Text = GetCubeUpdateDate(Request.QueryString["DBName"],Request.QueryString["CubeId"]);&lt;br&gt;
&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp; private string GetCubeUpdateDate (string dbName, string cubeId)&lt;br&gt;
&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; using (AMO.Server asServer = new AMO.Server())&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; asServer.Connect("Data Source=" + GetAnalysisServerName());&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AMO.Database db = asServer.DataBases.FindByName(dbName);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (db == null)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "DB Name not found";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AMO.Cube cube = GetCubeById(cubeId, db);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cube == null)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Cube Name not found";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime lastProcessed = cube.LastProcessed;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lastProcessed.Day.ToString() + "/" + lastProcessed.Month.ToString()
+ "/" + lastProcessed.Year.ToString();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp; private string GetAnalysisServerName ()&lt;br&gt;
&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlDocument xmlDoc = new XmlDocument();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlDoc.Load(Request.PhysicalApplicationPath + "config.xml");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return xmlDoc.GetElementsByTagName("ServerName").Item(0).InnetText;&lt;br&gt;
&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp; private AMO.Cube GetCubeById (string cubeId, AMO.Database db)&lt;br&gt;
&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (AMO.Cube cube in db.Cubes)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cube.ID.Equals(cubeId))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return cube;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br&gt;
&amp;nbsp; }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
Eventhough the code is self-explained, here are some points referring it:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
I chose not to include the server name in the web.config file because I like to seperate
application-related configuration and web configuration.&lt;/li&gt;
&lt;li&gt;
If you want you can get the cube name from the user (in the query string) and then
the code is even shorter - just get the cube like I got the database.&lt;/li&gt;
&lt;li&gt;
I wanted to show the date in the format DD/MM/YYYY, so that's why I did the long return
statement in the GetCubeUpdateDate method. If you want to return the date in the MM/DD/YYYY
format you can use the lastProcessed.GetShortDateFormat() method.&lt;/li&gt;
&lt;li&gt;
Note that when you publish the web site you need to create a dedicated virtual folder
in the IIS.&lt;/li&gt;
&lt;li&gt;
The user uses this site in the following way: All he need to do is to create a frame
with this site's address as its source and add it the DBName &amp;amp; CubeId in the query
string. In SharePoint it's even easier - the uses only need to create a page shower
web part.&lt;/li&gt;
&lt;/ul&gt;
enjoy.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=40de294b-84e7-4d53-bc33-fd023e9a514f" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,40de294b-84e7-4d53-bc33-fd023e9a514f.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=0e04645d-946e-4af3-8c8a-ef9eeb533674</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,0e04645d-946e-4af3-8c8a-ef9eeb533674.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,0e04645d-946e-4af3-8c8a-ef9eeb533674.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0e04645d-946e-4af3-8c8a-ef9eeb533674</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Yesterday, my friend Ilya asked me how
to perform average for dates. I explained him that actually, the dates in SQL Server
are represented as numbers, where zero is 01/01/1900. All you need to do is to cast
the dates to numbers, make average on them and getting the result back as date. Assuming
that the date column called MyDate, Here is the code:<br /><br />
Cast(Avg(cast(MyDate as float)) as datetime)<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0e04645d-946e-4af3-8c8a-ef9eeb533674" /></body>
      <title>Average of Dates</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,0e04645d-946e-4af3-8c8a-ef9eeb533674.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,0e04645d-946e-4af3-8c8a-ef9eeb533674.aspx</link>
      <pubDate>Wed, 19 Mar 2008 15:04:23 GMT</pubDate>
      <description>Yesterday, my friend Ilya asked me how to perform average for dates. I explained him that actually, the dates in SQL Server are represented as numbers, where zero is 01/01/1900. All you need to do is to cast the dates to numbers, make average on them and getting the result back as date. Assuming that the date column called MyDate, Here is the code:&lt;br&gt;
&lt;br&gt;
Cast(Avg(cast(MyDate as float)) as datetime)&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0e04645d-946e-4af3-8c8a-ef9eeb533674" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,0e04645d-946e-4af3-8c8a-ef9eeb533674.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=49397c1d-d6c2-4041-9848-efd0be80d8a0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,49397c1d-d6c2-4041-9848-efd0be80d8a0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,49397c1d-d6c2-4041-9848-efd0be80d8a0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=49397c1d-d6c2-4041-9848-efd0be80d8a0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Today I was in the Microsoft's Data Mining
Conference which took place in the Sheraton City Tower, Ramat-Gan (Israel, of course).
First of all - the food was good. :-) Now, seriously: All the lectures were great,
although they were performed by one man - Rafal Lukaweichi, which is a very talented
speaker. I think that I haven't seen such enthusiasm for many years in a lecture in
the IT world. Anyway, what have I learned today?<br /><ul><li>
The Data Mining world is very interesting indeed. Microsoft has a lot to offer in
DM and it is all ready-to-use in BIDS.</li><li>
Microsoft's approach is DM to the masses, which I don't believe it myself. Even though
the tools are very simple and even the code (DMX) is easy (in contradiction to MDX),
I don't think that an inexperienced developer can bring good results. The SAS approach
says that you need to have deep knowledge in statistics (which is bad), but I don't
think that DM can be made by the masses.</li><li>
There are many different DM algorithms which you need to be introduced with before
you start mining. As I mentioned, they tell you that all you need to know is what
each algorithm does in general, but in fact there are many parameters which you need
to adjust and play with, so in fact you need a good knowledge of these algorithms.</li><li>
Visualization is very important in DM. Even after you have good results in your hands,
you need good UI tools to show you the results in an efficient way or else you'll
be lost in a jungle of data.<br /></li><li>
If you already have a datawarehouse, you're half way from mining models. The preparation
of the data is a huge amount of the job in DM.</li><li>
After you have good results and even after you got good visualization of the results,
you need an expert from the company you work for (or in) that will look at the results
and tell you whether they bring new knowledge or they trivial.</li></ul>
I don't believe there's a change I'll be mining in the near future, but maybe I'll
play with it a little in my free time (which of course I don't have). Taking the data
of our datawarehouse and mining it can bring some interesting stuff. Who knows.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=49397c1d-d6c2-4041-9848-efd0be80d8a0" /></body>
      <title>Reviews From the Microsoft Data Mining Conference</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,49397c1d-d6c2-4041-9848-efd0be80d8a0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,49397c1d-d6c2-4041-9848-efd0be80d8a0.aspx</link>
      <pubDate>Mon, 21 Jan 2008 18:06:14 GMT</pubDate>
      <description>Today I was in the Microsoft's Data Mining Conference which took place in the Sheraton City Tower, Ramat-Gan (Israel, of course). First of all - the food was good. :-) Now, seriously: All the lectures were great, although they were performed by one man - Rafal Lukaweichi, which is a very talented speaker. I think that I haven't seen such enthusiasm for many years in a lecture in the IT world. Anyway, what have I learned today?&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
The Data Mining world is very interesting indeed. Microsoft has a lot to offer in
DM and it is all ready-to-use in BIDS.&lt;/li&gt;
&lt;li&gt;
Microsoft's approach is DM to the masses, which I don't believe it myself. Even though
the tools are very simple and even the code (DMX) is easy (in contradiction to MDX),
I don't think that an inexperienced developer can bring good results. The SAS approach
says that you need to have deep knowledge in statistics (which is bad), but I don't
think that DM can be made by the masses.&lt;/li&gt;
&lt;li&gt;
There are many different DM algorithms which you need to be introduced with before
you start mining. As I mentioned, they tell you that all you need to know is what
each algorithm does in general, but in fact there are many parameters which you need
to adjust and play with, so in fact you need a good knowledge of these algorithms.&lt;/li&gt;
&lt;li&gt;
Visualization is very important in DM. Even after you have good results in your hands,
you need good UI tools to show you the results in an efficient way or else you'll
be lost in a jungle of data.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
If you already have a datawarehouse, you're half way from mining models. The preparation
of the data is a huge amount of the job in DM.&lt;/li&gt;
&lt;li&gt;
After you have good results and even after you got good visualization of the results,
you need an expert from the company you work for (or in) that will look at the results
and tell you whether they bring new knowledge or they trivial.&lt;/li&gt;
&lt;/ul&gt;
I don't believe there's a change I'll be mining in the near future, but maybe I'll
play with it a little in my free time (which of course I don't have). Taking the data
of our datawarehouse and mining it can bring some interesting stuff. Who knows.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=49397c1d-d6c2-4041-9848-efd0be80d8a0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,49397c1d-d6c2-4041-9848-efd0be80d8a0.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=7473180e-117f-447f-b84c-38d91bbe3374</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,7473180e-117f-447f-b84c-38d91bbe3374.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,7473180e-117f-447f-b84c-38d91bbe3374.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7473180e-117f-447f-b84c-38d91bbe3374</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Although SSAS willl let you use them, some other application such as Panorama won't
function properly. I'll give one example: When you perform Drillthrough in Panorama,
on the fly the engine gererates a web page that will take the user to the next view.
The next view will be sliced as the current view, so this web page needs to pass the
dimensions parameter (meaning - the current slices). That's why this web page contains
this line:
</p>
        <p>
AttachParameters("Slicers","%Slicers%")
</p>
        <p>
A big problem will occur if one of the sliced dimensions will be sliced on a member
with a name that contains inverted commas ("). The JavaScript will result an error
because there are three inverted commas in the second parameter of the line. This
is only one example of what can happen in a BI consumer program if you'll use special
characters in member names. So - be careful not to pass these characters from the
DW (build the ETL so it will drop these characters) or giving those names in SSAS,
such as the All member name.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=7473180e-117f-447f-b84c-38d91bbe3374" />
      </body>
      <title>Do Not Use Special Characters in DW &amp; SSAS</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,7473180e-117f-447f-b84c-38d91bbe3374.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,7473180e-117f-447f-b84c-38d91bbe3374.aspx</link>
      <pubDate>Tue, 15 Jan 2008 14:08:32 GMT</pubDate>
      <description>&lt;p&gt;
Although SSAS willl let you use them, some other application such as Panorama won't
function properly. I'll give one example: When you perform Drillthrough in Panorama,
on the fly the engine gererates a web page that will take the user to the next view.
The next view will be sliced as the current view, so this web page needs to pass the
dimensions parameter (meaning - the current slices). That's why this web page contains
this line:
&lt;/p&gt;
&lt;p&gt;
AttachParameters("Slicers","%Slicers%")
&lt;/p&gt;
&lt;p&gt;
A big problem will occur if one of the sliced dimensions will be sliced on a member
with a name that contains inverted commas ("). The JavaScript will result an error
because there are three inverted commas in the second parameter of the line. This
is only one example of what can happen in a BI consumer program if you'll use special
characters in member names. So - be careful not to pass these characters from the
DW (build the ETL so it will drop these characters) or giving those names in SSAS,
such as the All member name.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=7473180e-117f-447f-b84c-38d91bbe3374" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,7473180e-117f-447f-b84c-38d91bbe3374.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/Panorama;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=2efa7c5b-826e-43c4-af42-5608fdd6c188</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2efa7c5b-826e-43c4-af42-5608fdd6c188</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I feel like I don't have the right to write about it after so many bits of information
were moving in the web about this subject but I would like to add my point of view
(or in fact - my point of code). First of all, I must mention some of those who written
about this subject before me. Mosha Pasumansky wrote a long <a href="http://sqljunkies.com/WebLog/mosha/archive/2007/05/22/current_date_mdx.aspx">post</a> about
it in last may. This post contains some ideas of how to come along with this problem,
but none of them is perfect. In fact (as always) - there is no perfect solution
for this problem. Another important source of knowledge can be found <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=346119&amp;SiteID=1">here</a> in
the MSDN forums, where Chris Webb, Thomas Pagel and others discussed it. Now,
I would like to add my solution. Take it or leave it - your choice.
</p>
        <p>
First of all, create a column in the time dimension that will be the current day indicator.
Thanks to the Data Source View or the UDM approach of SSAS 2005 you don't have to
change the relational table itself. Just add a named calculation in the DSV with expression
that will be 1 for the row of the current day and null or zero for the others. The
expression syntax itself depends on the underlying DB so I won't write it here, but
it's very simple. Add this column as an attribute (let's call it CurrentDayInd) in
the dimension structure and select its AttributeVisible propertiey to false. That's
because we don't need such Attribute Hierarchy in our time dimension. After that,
create a new User Hierarchy (you can call it Current Day), where the first level in
it will be CurrentDayInd and after it place the day (key) attribute.
</p>
        <p>
Now, what we have here? We have a hierarchy (Current Day) with two members - 1 and
zero. The 1 member has only one child which is the current day. Link that member to
your regular hierarchy (it's called YSQMD at my place) and here you have it. For example,
you can use it that way in the MDX script:
</p>
        <p>
Create Set [Last 30 Days] as<br />
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;[1].Children.Item(0),[Time].[YSQMD])<br />
:<br />
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;[1].Children.Item(0),[Time].[YSQMD]).Lag(30);
</p>
        <p>
I think that this solution is good and elegant. First of all, you don't have to use
external functions such as Now(). The second pro is that we use the native OLAP mechanism
which saves time and makes the queries run faster. Believe me, you'll feel the difference
with big cubes. The last thing is that this solution is easy to understand (at least
I think so) and it is easy for maintenance. The big con is that you have to process
this dimension (and related cubes) every day. I don't think that it's so bad because
most of the organizations do make process every day.
</p>
        <p>
          <br />
 
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2efa7c5b-826e-43c4-af42-5608fdd6c188" />
      </body>
      <title>Getting the Current Day in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</link>
      <pubDate>Tue, 08 Jan 2008 20:39:58 GMT</pubDate>
      <description>&lt;p&gt;
I feel like I don't have the right to write about it after so many bits of information
were moving in the web about this subject but I would like to add my point of view
(or in fact - my point of code). First of all, I must mention some of those who written
about this subject before me. Mosha Pasumansky wrote a long &lt;a href="http://sqljunkies.com/WebLog/mosha/archive/2007/05/22/current_date_mdx.aspx"&gt;post&lt;/a&gt; about
it in last may. This post contains some ideas of how to come along with this problem,
but none of them is perfect. In fact (as always) - there is no perfect&amp;nbsp;solution
for this problem. Another important source of knowledge can be found &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=346119&amp;amp;SiteID=1"&gt;here&lt;/a&gt; in
the MSDN forums, where Chris Webb, Thomas Pagel&amp;nbsp;and others discussed it. Now,
I would like to add my solution. Take it or leave it - your choice.
&lt;/p&gt;
&lt;p&gt;
First of all, create a column in the time dimension that will be the current day indicator.
Thanks to the Data Source View or the UDM approach of SSAS 2005 you don't have to
change the relational table itself. Just add a named calculation in the DSV with expression
that will be 1 for the row of the current day and null or zero for the others. The
expression syntax itself depends on the underlying DB so I won't write it here, but
it's very simple.&amp;nbsp;Add this column as an attribute (let's call it CurrentDayInd)&amp;nbsp;in
the dimension structure and select its AttributeVisible propertiey to false. That's
because we don't need such Attribute Hierarchy in our time dimension. After that,
create a new User Hierarchy (you can call it Current Day), where the&amp;nbsp;first level&amp;nbsp;in
it will be CurrentDayInd and after it place the day (key)&amp;nbsp;attribute.
&lt;/p&gt;
&lt;p&gt;
Now, what we have here? We have a hierarchy (Current Day) with two members - 1 and
zero. The 1 member has only one child which is the current day. Link that member to
your regular hierarchy (it's called YSQMD at my place) and here you have it. For example,
you can use it that way in the MDX script:
&lt;/p&gt;
&lt;p&gt;
Create Set [Last 30 Days] as&lt;br&gt;
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;amp;[1].Children.Item(0),[Time].[YSQMD])&lt;br&gt;
:&lt;br&gt;
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;amp;[1].Children.Item(0),[Time].[YSQMD]).Lag(30);
&lt;/p&gt;
&lt;p&gt;
I think that this solution is good and elegant. First of all, you don't have to use
external functions such as Now(). The second pro is that we use the native OLAP mechanism
which saves time and makes the queries run faster. Believe me, you'll feel the difference
with big cubes. The last thing is that this solution is easy to understand (at least
I think so) and it is easy for maintenance. The big con is that you have to process
this dimension (and related cubes) every day. I don't think that it's so bad because
most of the organizations do make process every day.
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2efa7c5b-826e-43c4-af42-5608fdd6c188" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a1c55658-cbf1-439d-88cc-d63ac1e2ba65</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a1c55658-cbf1-439d-88cc-d63ac1e2ba65</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As many of you already know, installation on Microsoft Excel on the SSAS 2005 server
is needed in order to use Excel functions in MDX. That's very helpful because MDX
is lack of many important functions such as Round (!). Many organizations don't like
it at all, but here's something that may help. In the SSAS 2005 server you don't need
to install the whole program, only the .Net programmability support. In the installation,
choose to manually pick up which components you wish to install and then
choose the .Net programmability Support as seen in the picture:
</p>
        <p>
          <img src="http://www.miky-schreiber.com/Blog/content/binary/excelProgSupport.GIF" border="0" />
        </p>
        <p>
Notice that this issue <a href="http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124864">will
not be fixed in SSAS 2008</a>, so this tip will be relevant for a long time.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a1c55658-cbf1-439d-88cc-d63ac1e2ba65" />
      </body>
      <title>Excel in the SSAS 2005/8 Server</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</link>
      <pubDate>Mon, 31 Dec 2007 08:06:00 GMT</pubDate>
      <description>&lt;p&gt;
As many of you already know, installation on Microsoft Excel on the SSAS 2005&amp;nbsp;server
is needed in order to use Excel functions in MDX. That's very helpful because MDX
is lack of many important functions such as Round (!). Many organizations don't like
it at all, but here's something that may help. In the SSAS 2005 server you don't need
to install the whole program, only the .Net programmability support. In the installation,
choose to manually&amp;nbsp;pick up&amp;nbsp;which components you wish to install and then
choose the .Net programmability Support as seen in the picture:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/excelProgSupport.GIF" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Notice that this issue &lt;a href="http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124864"&gt;will
not be fixed in SSAS 2008&lt;/a&gt;, so&amp;nbsp;this tip&amp;nbsp;will be relevant for a long time.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a1c55658-cbf1-439d-88cc-d63ac1e2ba65" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=e6cf2530-a4e4-4f9b-bff7-f7be5f470506</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,e6cf2530-a4e4-4f9b-bff7-f7be5f470506.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,e6cf2530-a4e4-4f9b-bff7-f7be5f470506.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e6cf2530-a4e4-4f9b-bff7-f7be5f470506</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week I participated in Microsoft's BI conference in Ra'anana, Israel. After the
conference I asked myself: What have I really learned today? Well, here is what I
remember:
</p>
        <ul>
          <li>
Microsoft figured out that the eternal BI tool is and will be Excel. People just love
their Excel sheets and they will stay there. This is why the mission is to bring the
BI into their Excel sheets. Their new product - Excel Services, will manage our excel
sheets in one central place which is connected to our Analysis Services cubes. 
</li>
          <li>
In my point of view, SQL Server 2008 is just a bunch of many performance issues and
it is not really a new product. There are a lot of new "performance features". For
example, most of our MDX queries will run faster, especially those who has null cells.
The new Cell-By-Cell calculations performance improvements will cause these queries
to run faster. I think that SS2008 could be one big Service Pack. If I'm wrong, please
do comment me. 
</li>
          <li>
SQL Server 2005 has many products that we don't know good enough. Some products that
I need to learn about are: Replication, SQL Server Agent, SQL CLR and more. I do know
what they do and even played with them a little bit, but I want to know how they can
help me and improve my work. 
</li>
          <li>
Many new features in SS2008 come from two old sources: <a href="http://www.codeplex.com/bidshelper">BIDS
Helper</a> (SSAS open source addin) and of-course, Oracle... 
</li>
          <li>
My big wish - IntelliSense for Analysis Services will not be in SSAS2008 and maybe
won't be at all. This is because the guessing is MDX is very hard. There are too many
options in every statement you write. 
</li>
          <li>
We won't need to upgrade to Office 2007 in order to use Excel Services. Only the developers
will need it.</li>
        </ul>
        <p>
This is what I remember for now. I'll update this post if something new will come
around in my mind.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e6cf2530-a4e4-4f9b-bff7-f7be5f470506" />
      </body>
      <title>Reviews from Microsoft BI Conference</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,e6cf2530-a4e4-4f9b-bff7-f7be5f470506.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,e6cf2530-a4e4-4f9b-bff7-f7be5f470506.aspx</link>
      <pubDate>Sun, 09 Dec 2007 12:26:17 GMT</pubDate>
      <description>&lt;p&gt;
Last week I participated in Microsoft's BI conference in Ra'anana, Israel. After the
conference I asked myself: What have I really learned today? Well, here is what I
remember:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Microsoft figured out that the eternal BI tool is and will be Excel. People just love
their Excel sheets and they will stay there. This is why the mission is to bring the
BI into their Excel sheets. Their new product - Excel Services, will manage our excel
sheets in one central place which is connected to our Analysis Services cubes. 
&lt;li&gt;
In my point of view, SQL Server 2008 is just a bunch of many performance issues and
it is not really a new product. There are a lot of new "performance features". For
example, most of our MDX queries will run faster, especially those who has null cells.
The new Cell-By-Cell calculations performance improvements will cause these queries
to run faster. I think that SS2008 could be one big Service Pack. If I'm wrong, please
do comment me. 
&lt;li&gt;
SQL Server 2005 has many products that we don't know good enough. Some products that
I need to learn about are: Replication, SQL Server Agent, SQL CLR and more. I do know
what they do and even played with them a little bit, but I want to know how they can
help me and improve my work. 
&lt;li&gt;
Many new features in SS2008 come from two old sources: &lt;a href="http://www.codeplex.com/bidshelper"&gt;BIDS
Helper&lt;/a&gt; (SSAS open source addin) and of-course, Oracle... 
&lt;li&gt;
My big wish - IntelliSense for Analysis Services will not be in SSAS2008 and maybe
won't be at all. This is because the guessing is MDX is very hard. There are too many
options in every statement you write. 
&lt;li&gt;
We won't need to upgrade to Office 2007 in order to use Excel Services. Only the developers
will need it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
This is what I remember for now. I'll update this post if something new will come
around in my mind.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e6cf2530-a4e4-4f9b-bff7-f7be5f470506" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,e6cf2530-a4e4-4f9b-bff7-f7be5f470506.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008</category>
    </item>
  </channel>
</rss>