<?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 2005</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=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=fd39d7a9-4217-449b-ae66-f0a582eed50a</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,fd39d7a9-4217-449b-ae66-f0a582eed50a.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,fd39d7a9-4217-449b-ae66-f0a582eed50a.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=fd39d7a9-4217-449b-ae66-f0a582eed50a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
For documentation purposes: When you get "Unexpected error occured: Error in Application"
error in SSAS while trying to view the cube's calculations tab, you'll need to close
BIDS and <a href="http://www.bronios.com/index.php/2007/06/13/unexpected-error-occured-viewing-calculations-tab-for-ssas-project">do
some file copy tasks</a>.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=fd39d7a9-4217-449b-ae66-f0a582eed50a" />
      </body>
      <title>Unexpected Error when viewing Calculations in SSAS</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,fd39d7a9-4217-449b-ae66-f0a582eed50a.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,fd39d7a9-4217-449b-ae66-f0a582eed50a.aspx</link>
      <pubDate>Mon, 04 Jan 2010 09:22:08 GMT</pubDate>
      <description>&lt;p&gt;
For documentation purposes: When you get "Unexpected error occured: Error in Application"
error in SSAS while trying to view the cube's calculations tab, you'll need to close
BIDS and &lt;a href="http://www.bronios.com/index.php/2007/06/13/unexpected-error-occured-viewing-calculations-tab-for-ssas-project"&gt;do
some file copy tasks&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=fd39d7a9-4217-449b-ae66-f0a582eed50a" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,fd39d7a9-4217-449b-ae66-f0a582eed50a.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/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=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=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=359beb7d-d8dc-42f0-96b0-5782626bee19</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=359beb7d-d8dc-42f0-96b0-5782626bee19</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One more thing about <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx">getting
a file from the web/SharePoint and using it as a source in SSIS</a>: If you need to
authenticate just change the xml.open command to:
</p>
        <p>
xml.open "GET", URL, false, "user", "password"
</p>
        <p>
where user and password are the user &amp; password that has permissions to the desired
file. Note that it is VERY recommended to have an application user, so the password
won't be changed in the future. If you don't have such user and you must change your
password in the future, do not forget to change it in the script. My tip: add a reminder
in your calendar to change the password in the script.
</p>
        <p>
In this point I don't know if you can authenticate using SSL or stronger protocols
using VB script.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=359beb7d-d8dc-42f0-96b0-5782626bee19" />
      </body>
      <title>Using Web or SharePoint File as a Source in SSIS - Authentication</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx</link>
      <pubDate>Tue, 22 Apr 2008 12:20:05 GMT</pubDate>
      <description>&lt;p&gt;
One more thing about &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx"&gt;getting
a file from the web/SharePoint and using it as a source in SSIS&lt;/a&gt;: If you need to
authenticate just change the xml.open command to:
&lt;/p&gt;
&lt;p&gt;
xml.open "GET", URL, false, "user", "password"
&lt;/p&gt;
&lt;p&gt;
where user and password are the user &amp;amp; password that has permissions to the desired
file. Note that it is VERY recommended to have an application user, so the password
won't be changed in the future. If you don't have such user and you must change your
password in the future, do not forget to change it in the script. My tip: add a reminder
in your calendar to change the password in the script.
&lt;/p&gt;
&lt;p&gt;
In this point I don't know if you can authenticate using SSL or stronger protocols
using VB script.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=359beb7d-d8dc-42f0-96b0-5782626bee19" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration 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=c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">It figures that using simple excel file
as a source in SSIS is not so trivial, especially if your source is in the web or
in your SharePoint portal. At first you'll think it's easy - just declare the excel
source as a url (the url of the excel file, for example) and it will succeed. The
problem is that Microsoft let you think it's working. Click on the excel source and
you'll see in its properties that the source path is the local temporary internet
files, meaning that the source is a local copy which is not up-to-date, so it's worth
nothing.<br />
Here's what I tried to do and the final (and successful solution):<br /><br />
1. Use the File System task. It won't work because you can't declare an URI there.<br />
2. In the MSDN forum (I can't find the link right now) they say to write a script,
so I also tried this. Using the Script task, I written a code in VB.NET which using
the System.IO libary of the .NET framework and copies the excel file (using its URI)
to the desired location in the local computer. Running it, I got an error saying that
the script can't use URIs...<br />
After trying this I understood that every code or action running in the SSIS context
won't work with URIs. I'm not sure I know why Microsoft developers built it that way
(or maybe it's just another bug). Anyway, the next step is the solution.<br />
3. Build an executable file that performs the desired copy task. You can't use regular
batch (.bat) file because DOS/CmdExec does not know how to work with URIs. So, there
are two ways to perform this:<br />
a. Download <a href="http://users.ugent.be/~bpuype/wget/">this</a> and use it as a
copier from the web.<br />
b. Use the following code and save it as a Visual Basic Script file (*.vbs):<br /><br /><div dir="ltr"><div style="TEXT-ALIGN: left"><b></b>'GetRemoteBinaryFile.vbs<br />
TheFile = "myExcelFile.xls"<br />
DestFolder = "C:\SSIS_Sources"<br />
URL = "http://mySite/myFolder/myExcelFile.xls"<br />
Set xml = CreateObject("Microsoft.XMLHTTP")<br />
xml.Open "GET", URL, False<br />
xml.Send<br />
set oStream = CreateObject("Adodb.Stream")<br />
Const adTypeBinary = 1<br />
Const adSaveCreateOverWrite = 2<br />
Const adSaveCreateNotExist = 1 
<br />
oStream.type = adTypeBinary<br />
oStream.open<br />
oStream.write xml.responseBody<br />
' Overwrite an existing file<br />
oStream.savetofile DestFolder &amp; TheFile, adSaveCreateOverWrite<br />
oStream.close<br />
set oStream = nothing<br />
Set xml = Nothing<br /></div></div><br />
After you have your file (vbs or exe) you can use the Execute Process Task in order
to make the copy. In the task, declare that you want it to run your exe or vbs. 
After that, just use a normal Data Flow Task, where the source excel file is in the
local computer (the file that was copied in the previous task) and the destination
is your desired DB.<br /><br />
Note that:<br />
1. Before executing you must have the excel file already placed in your local computer,
meaning that you must make the first copy before the first time you run the package.
This is because SSIS performs integrity check before running the package and it checks
that the file exists.<br />
2. Even if the copy process is long (because it's coming from the web), don't worry.
SSIS work synchroniously, meaning that the Data Flow task will not start until the
Execute Process task which copies the file will end.<br /><br />
Enjoy.<br /><br /><u>Update:</u> I added a <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx">post
about authentication</a>.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6" /></body>
      <title>Using Web or SharePoint File as a Source in SSIS</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx</link>
      <pubDate>Sat, 15 Mar 2008 21:47:26 GMT</pubDate>
      <description>It figures that using simple excel file as a source in SSIS is not so trivial, especially if your source is in the web or in your SharePoint portal. At first you'll think it's easy - just declare the excel source as a url (the url of the excel file, for example) and it will succeed. The problem is that Microsoft let you think it's working. Click on the excel source and you'll see in its properties that the source path is the local temporary internet files, meaning that the source is a local copy which is not up-to-date, so it's worth nothing.&lt;br&gt;
Here's what I tried to do and the final (and successful solution):&lt;br&gt;
&lt;br&gt;
1. Use the File System task. It won't work because you can't declare an URI there.&lt;br&gt;
2. In the MSDN forum (I can't find the link right now) they say to write a script,
so I also tried this. Using the Script task, I written a code in VB.NET which using
the System.IO libary of the .NET framework and copies the excel file (using its URI)
to the desired location in the local computer. Running it, I got an error saying that
the script can't use URIs...&lt;br&gt;
After trying this I understood that every code or action running in the SSIS context
won't work with URIs. I'm not sure I know why Microsoft developers built it that way
(or maybe it's just another bug). Anyway, the next step is the solution.&lt;br&gt;
3. Build an executable file that performs the desired copy task. You can't use regular
batch (.bat) file because DOS/CmdExec does not know how to work with URIs. So, there
are two ways to perform this:&lt;br&gt;
a. Download &lt;a href="http://users.ugent.be/~bpuype/wget/"&gt;this&lt;/a&gt; and use it as a
copier from the web.&lt;br&gt;
b. Use the following code and save it as a Visual Basic Script file (*.vbs):&lt;br&gt;
&lt;br&gt;
&lt;div dir=ltr&gt;
&lt;div style="TEXT-ALIGN: left"&gt;&lt;b&gt;&lt;/b&gt;'GetRemoteBinaryFile.vbs&lt;br&gt;
TheFile = "myExcelFile.xls"&lt;br&gt;
DestFolder = "C:\SSIS_Sources"&lt;br&gt;
URL = "http://mySite/myFolder/myExcelFile.xls"&lt;br&gt;
Set xml = CreateObject("Microsoft.XMLHTTP")&lt;br&gt;
xml.Open "GET", URL, False&lt;br&gt;
xml.Send&lt;br&gt;
set oStream = CreateObject("Adodb.Stream")&lt;br&gt;
Const adTypeBinary = 1&lt;br&gt;
Const adSaveCreateOverWrite = 2&lt;br&gt;
Const adSaveCreateNotExist = 1 
&lt;br&gt;
oStream.type = adTypeBinary&lt;br&gt;
oStream.open&lt;br&gt;
oStream.write xml.responseBody&lt;br&gt;
' Overwrite an existing file&lt;br&gt;
oStream.savetofile DestFolder &amp;amp; TheFile, adSaveCreateOverWrite&lt;br&gt;
oStream.close&lt;br&gt;
set oStream = nothing&lt;br&gt;
Set xml = Nothing&lt;br&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
After you have your file (vbs or exe) you can use the Execute Process Task in order
to make the copy. In the task, declare that you want it to run your exe or vbs.&amp;nbsp;
After that, just use a normal Data Flow Task, where the source excel file is in the
local computer (the file that was copied in the previous task) and the destination
is your desired DB.&lt;br&gt;
&lt;br&gt;
Note that:&lt;br&gt;
1. Before executing you must have the excel file already placed in your local computer,
meaning that you must make the first copy before the first time you run the package.
This is because SSIS performs integrity check before running the package and it checks
that the file exists.&lt;br&gt;
2. Even if the copy process is long (because it's coming from the web), don't worry.
SSIS work synchroniously, meaning that the Data Flow task will not start until the
Execute Process task which copies the file will end.&lt;br&gt;
&lt;br&gt;
Enjoy.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;Update:&lt;/u&gt; I added a &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,359beb7d-d8dc-42f0-96b0-5782626bee19.aspx"&gt;post
about authentication&lt;/a&gt;.&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=c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,c4c8328e-a5b8-4d6e-99ad-83f9f316b2d6.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services;Tips &amp; Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=06b1f3d3-fb6f-435a-9c63-769100013c02</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,06b1f3d3-fb6f-435a-9c63-769100013c02.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,06b1f3d3-fb6f-435a-9c63-769100013c02.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=06b1f3d3-fb6f-435a-9c63-769100013c02</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">This is a good one: When you build a flat
file connection to a csv file, you can preview the data. There, there's an option
to skip some rows (Data rows to skip). If you'll leave it with a number greater than
zero - the process itself will skip these rows!! I still wonder if this bug is By
Design or not. If you wish, you can track this bug in <a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=325384">Microsoft
Connect</a>.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=06b1f3d3-fb6f-435a-9c63-769100013c02" /></body>
      <title>SSIS Flat File Preview (Funny) Bug</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,06b1f3d3-fb6f-435a-9c63-769100013c02.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,06b1f3d3-fb6f-435a-9c63-769100013c02.aspx</link>
      <pubDate>Fri, 01 Feb 2008 05:00:16 GMT</pubDate>
      <description>This is a good one: When you build a flat file connection to a csv file, you can preview the data. There, there's an option to skip some rows (Data rows to skip). If you'll leave it with a number greater than zero - the process itself will skip these rows!! I still wonder if this bug is By Design or not. If you wish, you can track this bug in &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=325384"&gt;Microsoft
Connect&lt;/a&gt;.&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=06b1f3d3-fb6f-435a-9c63-769100013c02" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,06b1f3d3-fb6f-435a-9c63-769100013c02.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services</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=d2331638-e60a-45c7-9f5b-8becf2483179</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,d2331638-e60a-45c7-9f5b-8becf2483179.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,d2331638-e60a-45c7-9f5b-8becf2483179.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d2331638-e60a-45c7-9f5b-8becf2483179</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the previous parts (<a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx">1</a>, <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx">2</a>) I
showed how to connect Informatica with MS-OLAP, meaning that a mapplet can process
cube or dimension. The thing is that I focused on the side of MS-OLAP. In the second
part I even wrote the T-SQL code itself. Now I want to close the loop by describing
what's going on in the Informatica side. This part was made by my friend, Alex, who
permitted me to post here about what he did.
</p>
        <p>
First of all, there's a table which contains the parameters to call with to the MS-OLAP
procedure (object id, type, user name, etc.). This table is the source (&amp; source
qualifier, of course) of the mapplet. Each row in this table calls the stored procedure
in the MS-OLAP side (in fact, the procedure is part of the relational DB, but never
mind now). The call to the SP is made with Informatica's Procedure block. The connection
is a regular ODBC connection, as mentioned in the previous part. Now for the interesting
part: In the mapplet, the result of the procedure (zero for success, one for failure)
goes into a Java Transformation block. This java block will fail the mapplet if one
or more procedure calls returned failure.
</p>
        <p>
How to do this java block? Double click on it to enter its properties. Go to the "Java
Code" tab. There you'll see tab for every event in this block's life cycle. Here is
the code for every tab (only the relevant ones):
</p>
        <p>
Helper Code:
</p>
static int errorCounter = 0;<br />
static Object lock = new Object();<br /><p>
On Input Row:
</p>
if (returnValue != 0)<br />
{<br />
 synchronized(lock)<br />
  {<br />
   errorCounter++;<br />
  }<br />
}<br /><p>
On End of Data: 
</p><p>
synchronized(lock)<br />
{<br />
 if (errorCounter &gt; 0)<br />
  {<br />
   failSession("OLAP Objects failed");<br />
  }<br />
} 
</p><p>
Note that:
</p><ul><li>
I'm not sure that the lock mechanism is required here. sync, lock, semaphore, etc.
mechanisms are often used when atomic write is needed in order to solve problems
like deadlocks, mutual write, etc. Here I simply don't care. Even if two parallel
threads will read the errorCounter as zero and they both will increase it to one (when
in fact it needs to have the value of two) it won't be a bug because the session will
fail anyway. Alex &amp; I need to talk about this point...</li><li>
failSession is a function which is part of Informatica's API. As you might guess,
it will fail the whole mapplet.</li><li>
Very important: Calling all the MS-OLAP objects at once will cause an error in the
Analysis Services server and all the objects will be in the state of Unprocessed.
The Informatica side has to call the dimensions first and only then the cubes. The
cubes must not be called all at once if they have relationships between them. This
will cause deadlock too.<br /></li></ul><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=d2331638-e60a-45c7-9f5b-8becf2483179" /></body>
      <title>Connecting Informatica with MS-OLAP - Part III</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,d2331638-e60a-45c7-9f5b-8becf2483179.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,d2331638-e60a-45c7-9f5b-8becf2483179.aspx</link>
      <pubDate>Mon, 07 Jan 2008 20:35:17 GMT</pubDate>
      <description>&lt;p&gt;
In the previous parts (&lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx"&gt;1&lt;/a&gt;, &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx"&gt;2&lt;/a&gt;)&amp;nbsp;I
showed how to connect Informatica with MS-OLAP, meaning that a mapplet can process
cube or dimension. The thing is that I focused on the side of MS-OLAP. In the second
part I even&amp;nbsp;wrote the T-SQL code itself. Now I want to close the loop by describing
what's going on in the Informatica side. This part was made by my friend, Alex, who
permitted me to post here about what he did.
&lt;/p&gt;
&lt;p&gt;
First of all, there's a table which contains the parameters to call with to the MS-OLAP
procedure (object id, type, user name, etc.). This table is the source (&amp;amp; source
qualifier, of course) of the mapplet. Each row in this table calls the stored procedure
in the MS-OLAP side (in fact, the procedure is part of the relational DB, but never
mind now). The call to the SP is made with Informatica's Procedure block. The connection
is a regular ODBC connection, as mentioned in the previous part. Now for the interesting
part: In the mapplet, the result of the procedure (zero for success, one for failure)
goes into a Java Transformation block. This java block will fail the mapplet if one
or more procedure calls returned failure.
&lt;/p&gt;
&lt;p&gt;
How to do this java block? Double click on it to enter its properties. Go to the "Java
Code" tab. There you'll see tab for every event in this block's life cycle. Here is
the code for every tab (only the relevant ones):
&lt;/p&gt;
&lt;p&gt;
Helper Code:
&lt;/p&gt;
static int errorCounter = 0;&lt;br&gt;
static Object lock = new Object();&lt;br&gt;
&lt;p&gt;
On Input Row:
&lt;/p&gt;
if (returnValue != 0)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;synchronized(lock)&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;errorCounter++;&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
}&lt;br&gt;
&lt;p&gt;
On End of Data: 
&lt;p&gt;
synchronized(lock)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;if (errorCounter &amp;gt; 0)&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;failSession("OLAP Objects failed");&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
} 
&lt;/p&gt;
&lt;p&gt;
Note that:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
I'm not sure that the lock mechanism is required here. sync, lock, semaphore, etc.
mechanisms&amp;nbsp;are often used when atomic write is needed in order to solve problems
like deadlocks, mutual write, etc. Here I simply don't care. Even if two parallel
threads will read the errorCounter as zero and they both will increase it to one (when
in fact it needs to have the value of two) it won't be a bug because the session will
fail anyway. Alex &amp;amp; I need to talk about this point...&lt;/li&gt;
&lt;li&gt;
failSession is a function which is part of Informatica's API. As you might guess,
it will fail the whole mapplet.&lt;/li&gt;
&lt;li&gt;
Very important: Calling all the MS-OLAP objects at once will cause an error in the
Analysis Services server and all the objects will be in the state of Unprocessed.
The Informatica side has to call the dimensions first and only then the cubes. The
cubes must not be called all at once if they have relationships between them. This
will cause deadlock too.&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=d2331638-e60a-45c7-9f5b-8becf2483179" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,d2331638-e60a-45c7-9f5b-8becf2483179.aspx</comments>
      <category>BI;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/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>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=d6688032-fdd3-46a7-aff9-bf647b069535</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d6688032-fdd3-46a7-aff9-bf647b069535</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>Connecting Informatica with MS-OLAP - Part II</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx</link>
      <pubDate>Sun, 02 Dec 2007 08:59:42 GMT</pubDate>
      <description>&lt;p&gt;
In the &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx"&gt;last
post&lt;/a&gt;, I explained the architecture of our BI project. The final part of the process
is processing MS-OLAP object (cube/dimension) from Informatica mapplet. As explained
earlier, the trick is to call Stored Procedure from the Informatica server. But first
there is one more thing to do: How do you connect the Informatica server (Linux) with
MS-OLAP (windows server)?
&lt;/p&gt;
&lt;p&gt;
Informatica ships with number of drivers that can connect it with other servers. The
drivers are called DataDirect and I'll discuss 4.20. You need to define this driver
on the Informatica server (look in Informatica knowledge base for more information).
This is an easy thing to do. Notice that you have to enter a full server name (including
domain) and the password. Remember that if you'll change the password in the future
the process will fail. You have to enable the protocol named "Named Pipes" in the
MS-OLAP server. How to do this? Enter the Configuration Manager in the MS-OLAP server
and in the section of MSSQLSERVER protocols enable the Named Pipes protocol. This
will enable the connection from the Informatica server. On the Informatica server,
make a regular ODBC connection.
&lt;/p&gt;
&lt;p&gt;
Here is the code of the SP on the MS-OLAP side. This SP must be on the msdb Database
on the Database engine.
&lt;/p&gt;
&lt;p&gt;
ALTER PROCEDURE [dbo].[ProcessObject]&lt;br&gt;
@databaseId varchar(100),&lt;br&gt;
@objectType varchar(100),&lt;br&gt;
@objectId varchar(100),&lt;br&gt;
@login_name varchar(100),&lt;br&gt;
@returnValue int output,&lt;br&gt;
@errorMessage nvarchar(1024) output&lt;br&gt;
AS&lt;br&gt;
BEGIN&lt;br&gt;
declare @jobName varchar(200)&lt;br&gt;
declare @xmla varchar(1000)&lt;br&gt;
declare @jobId binary(16)&lt;br&gt;
declare @ReturnCode int&lt;br&gt;
declare @stop int&lt;br&gt;
&lt;br&gt;
--Set job name&lt;br&gt;
set @jobName = 'Process' + @objectType + '_' + @objectId&lt;br&gt;
&lt;br&gt;
--Delete the job if already exists&lt;br&gt;
if exists (select * from msdb.dbo.sysjobs where name = @jobName)&lt;br&gt;
exec msdb.dbo.sp_delete_job @job_name = @jobName&lt;br&gt;
&lt;br&gt;
--Create the job&lt;br&gt;
Exec msdb.dbo.sp_add_job @job_name=@jobName&lt;br&gt;
@enabled=1,&lt;br&gt;
@notify_level_eventlog=0,&lt;br&gt;
@notify_level_email=0,&lt;br&gt;
@notify_level_netsend=0,&lt;br&gt;
@notify_level_page=0,&lt;br&gt;
@delete_level=0,&lt;br&gt;
@description=N'process OLAP object',&lt;br&gt;
@category_name=N'[Uncategorized (Local)]',&lt;br&gt;
@owner_login_name=@login_name, @job_id=@jobId output&lt;br&gt;
&lt;br&gt;
exec msdb.dbo.sp_add_jobserver @job_name=@jobName, @server_name=@@SERVERNAME&lt;br&gt;
&lt;br&gt;
--Declare XMLA for OLAP object&lt;br&gt;
if (@objectType = 'Cube')&lt;br&gt;
set @xmla = '&lt;PROCESS xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"&gt;
&lt;br&gt;
&lt;object&gt;
&lt;br&gt;
&lt;DatabaseID&gt;
' + @dataBaseId + '
&lt;/DatabaseID&gt;
&lt;br&gt;
&lt;CubeID&gt;
' + @objectId + '
&lt;/CubeID&gt;
&lt;br&gt;
&lt;/object&gt;
&lt;br&gt;
&lt;TYPE&gt;
ProcessFull
&lt;/TYPE&gt;
&lt;br&gt;
&lt;/PROCESS&gt;
'&lt;br&gt;
else if (@objectType = 'Dim')&lt;br&gt;
set @xmla = 
&lt;BATCH xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"&gt;
&lt;br&gt;
&lt;PARALLEL&gt;
&lt;br&gt;
&lt;PROCESS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;br&gt;
&lt;object&gt;
&lt;br&gt;
&lt;DatabaseID&gt;
' + @dataBaseId + '
&lt;/DataBaseID&gt;
&lt;br&gt;
&lt;DimensionID&gt;
' + @objectId + '
&lt;/DimensionID&gt;
&lt;br&gt;
&lt;/object&gt;
&lt;br&gt;
&lt;TYPE&gt;
ProcessFull
&lt;/TYPE&gt;
&lt;br&gt;
&lt;/PROCESS&gt;
&lt;br&gt;
&lt;/PARALLEL&gt;
&lt;br&gt;
&lt;/BATCH&gt;
'&lt;br&gt;
else&lt;br&gt;
Begin&lt;br&gt;
set @returnValue = 0&lt;br&gt;
return @returnValue&lt;br&gt;
End&lt;br&gt;
&lt;br&gt;
--Add the job step&lt;br&gt;
Exec msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Process Object',&lt;br&gt;
@step_id=1,&lt;br&gt;
@cmdexec_success_code=0,&lt;br&gt;
@on_success_action=1,&lt;br&gt;
@on_success_step_id=0,&lt;br&gt;
@on_fail_action=2,&lt;br&gt;
@on_fail_step_id=0,&lt;br&gt;
@retry_attempts=0,&lt;br&gt;
@retry_interval=0,&lt;br&gt;
@os_run_priority=0, @subsystem=N'ANALYSISCOMMAND',&lt;br&gt;
@command=@xmla,&lt;br&gt;
@server=@@SERVERNAME,&lt;br&gt;
@database_name=N'master',&lt;br&gt;
@flags=0&lt;br&gt;
&lt;br&gt;
--Run the job&lt;br&gt;
Execute sp_start_job @jobName&lt;br&gt;
&lt;br&gt;
Waitfor delay '00:00:05'&lt;br&gt;
set @returnValue = (select run_status from dbo.sysjobhistory&lt;br&gt;
where job_id = @jobId&lt;br&gt;
and step_id = 1)&lt;br&gt;
&lt;br&gt;
-- Loop until the job ends and return its result&lt;br&gt;
set @stop = 0&lt;br&gt;
if @returnValue is null&lt;br&gt;
while @stop &amp;lt;&amp;gt; 1&lt;br&gt;
Begin&lt;br&gt;
set @returnValue = (select run_status from dbo.sysjobhistory&lt;br&gt;
where job_id = @jobId&lt;br&gt;
and step_id = 1)&lt;br&gt;
&lt;br&gt;
if @returnValue is not null&lt;br&gt;
set @stop = 1&lt;br&gt;
&lt;br&gt;
waitfor delay '00:00:10'&lt;br&gt;
End&lt;br&gt;
&lt;br&gt;
--Return error message (if exists)&lt;br&gt;
If @returnValue = 0 --failed&lt;br&gt;
set @errorMessage = (select [message] from dbo.sysjobhistory&lt;br&gt;
where job_id = @jobId&lt;br&gt;
and step_id = 1)&lt;br&gt;
End
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#ff0000&gt;&lt;u&gt;update:&lt;/u&gt; &lt;/font&gt;&lt;font color=#000000&gt;I see that the xmla
code went bad in the post because it is not recognised html code. It doesn't matter,
I believe you got the point...&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=d6688032-fdd3-46a7-aff9-bf647b069535" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,d6688032-fdd3-46a7-aff9-bf647b069535.aspx</comments>
      <category>BI;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=bd657303-2777-4d14-94bb-2aafce915ff3</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bd657303-2777-4d14-94bb-2aafce915ff3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the past I mentioned some fragments of the architecture of our end-to-end BI solution.
Now I'll discuss how it is done. I will only write about the things that I done (I
mean, developed) but I'll describe the whole picture.
</p>
        <p>
Our architecture goes like this: <a href="http://en.wikipedia.org/wiki/CONTROL-M">Control
M</a> -&gt; Informatica -&gt; MS-OLAP (Analysis Services 2005).
</p>
        <p>
In words: ControlM is the most common scheduler in big companies. We use it to schedule
our ETL processes in Informatica. Our system team made it possible to start Informatica
processes from ControlM. I don't know exactly how it is done. All I know is that ControlM
raises a flag in a table, and Informatica scans the table every X seconds and start
the process if it finds the flag that was raised by ControlM. Don't ask me about the
technical details - it wasn't my job.
</p>
        <p>
The more interesting thing (because I did it...) is how Informatica calls MS-OLAP
and tells it to process a cube. In this part I'll describe the big picture and in
the next one I'll give some of the code and discuss some technical views of the
process. First, the Informatica mapping moves the data from the source to the
target, which is the dimension or fact table just like it always does. After that,
Informatica calls a Stored Procedure on the MS-OLAP server which process the cube.
Informatica calls this SP with some parameters, including the object type to process
(cube/dimension), its ID and some more parameters. In return, the MS-OLAP returns
return code (in order to point whether the process succeeded) and message describing
the error if it occurred.
</p>
        <p>
How the SP process the cube/dimension? Unfortunately, there is no SP that can process
OLAP object so I needed to use the following steps in my SP:
</p>
        <ol>
          <li>
Delete any existing job that does the same action (read on, you'll understand)</li>
          <li>
Create an empty job</li>
          <li>
Add a step to that job that will process the object. This step contains XMLA code
that contains the parameters that were given from Informatica</li>
          <li>
Run the job</li>
          <li>
Loop until the job (or process) ends and send back the return code and the error message,
if exists.</li>
        </ol>
        <p>
In the next part I'll write some of the code and discuss some technical issues.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=bd657303-2777-4d14-94bb-2aafce915ff3" />
      </body>
      <title>Connecting Informatica with MS-OLAP - Part I</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx</link>
      <pubDate>Sat, 01 Dec 2007 20:19:47 GMT</pubDate>
      <description>&lt;p&gt;
In the past I mentioned some fragments of the architecture of our end-to-end BI solution.
Now I'll discuss how it is done. I will only write about the things that I done (I
mean, developed) but I'll describe the whole picture.
&lt;/p&gt;
&lt;p&gt;
Our architecture goes like this: &lt;a href="http://en.wikipedia.org/wiki/CONTROL-M"&gt;Control
M&lt;/a&gt; -&amp;gt; Informatica -&amp;gt; MS-OLAP (Analysis Services 2005).
&lt;/p&gt;
&lt;p&gt;
In words: ControlM is the most common scheduler in big companies. We use it to schedule
our ETL processes in Informatica. Our system team made it possible to start Informatica
processes from ControlM. I don't know exactly how it is done. All I know is that ControlM
raises a flag in a table, and Informatica scans the table every X seconds and start
the process if it finds the flag that was raised by ControlM. Don't ask me about the
technical details - it wasn't my job.
&lt;/p&gt;
&lt;p&gt;
The more interesting thing (because I did it...) is how Informatica calls MS-OLAP
and tells it to process a cube. In this part I'll describe the big picture and in
the next one I'll give some of the code and discuss some technical&amp;nbsp;views of the
process.&amp;nbsp;First, the Informatica mapping moves the data from the source to the
target, which is the dimension or fact table just like it always does. After that,
Informatica calls a Stored Procedure on the MS-OLAP server which process the cube.
Informatica calls this SP with some parameters, including the object type to process
(cube/dimension), its ID and some more parameters. In return, the MS-OLAP returns
return code (in order to point whether the process succeeded) and message describing
the error if it occurred.
&lt;/p&gt;
&lt;p&gt;
How the SP process the cube/dimension? Unfortunately, there is no SP that can process
OLAP object so I needed to use the following steps in my SP:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Delete any existing job that does the same action (read on, you'll understand)&lt;/li&gt;
&lt;li&gt;
Create an empty job&lt;/li&gt;
&lt;li&gt;
Add a step to that job that will process the object. This step contains XMLA code
that contains the parameters that were given from Informatica&lt;/li&gt;
&lt;li&gt;
Run the job&lt;/li&gt;
&lt;li&gt;
Loop until the job (or process) ends and send back the return code and the error message,
if exists.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
In the next part I'll write some of the code and discuss some technical issues.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=bd657303-2777-4d14-94bb-2aafce915ff3" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,bd657303-2777-4d14-94bb-2aafce915ff3.aspx</comments>
      <category>BI;BI/Informatica;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=06e8e7c8-0dab-47f2-aa87-a19e7907675f</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,06e8e7c8-0dab-47f2-aa87-a19e7907675f.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,06e8e7c8-0dab-47f2-aa87-a19e7907675f.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=06e8e7c8-0dab-47f2-aa87-a19e7907675f</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">After our first MS-OLAP first installation,
I started asking myself some questions: The way we moved our cubes to the production
server is by the Visual Studio. We just deployed the cubes into the production server.
The problem was that we forgot that we had some changes done in the XMLA code that
lies behind one of our cubes. That caused some troubles in the installation and the
result was that we did some changes in the XMLA script in the production server <b>after
the installation</b>...<br />
So, how we should make the installation? Should we export the whole database and import
it in the production server, or should we generate XMLA scripts and run it in the
production server? Is there really a difference between these choices? 
<br />
If someone has an answer I would be very happy to read it. Thanks...<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=06e8e7c8-0dab-47f2-aa87-a19e7907675f" /></body>
      <title>Question about installation of SSAS 2005 cubes</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,06e8e7c8-0dab-47f2-aa87-a19e7907675f.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,06e8e7c8-0dab-47f2-aa87-a19e7907675f.aspx</link>
      <pubDate>Tue, 06 Nov 2007 19:17:55 GMT</pubDate>
      <description>After our first MS-OLAP first installation, I started asking myself some questions: The way we moved our cubes to the production server is by the Visual Studio. We just deployed the cubes into the production server. The problem was that we forgot that we had some changes done in the XMLA code that lies behind one of our cubes. That caused some troubles in the installation and the result was that we did some changes in the XMLA script in the production server &lt;b&gt;after
the installation&lt;/b&gt;...&lt;br&gt;
So, how we should make the installation? Should we export the whole database and import
it in the production server, or should we generate XMLA scripts and run it in the
production server? Is there really a difference between these choices? 
&lt;br&gt;
If someone has an answer I would be very happy to read it. Thanks...&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=06e8e7c8-0dab-47f2-aa87-a19e7907675f" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,06e8e7c8-0dab-47f2-aa87-a19e7907675f.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=7d32fc2b-dcb2-46ea-899a-fb5ea104688a</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,7d32fc2b-dcb2-46ea-899a-fb5ea104688a.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,7d32fc2b-dcb2-46ea-899a-fb5ea104688a.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7d32fc2b-dcb2-46ea-899a-fb5ea104688a</wfw:commentRss>
      <slash:comments>6</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">It took me a while (more than 15 minutes!)
to find something so elementary. The thing is how to call a sleep function in T-SQL
in SS2005. The statement is: Waitfor Delay &lt;DelayLength&gt;, where &lt;DelayLength&gt;
can be in the format: '00:00:10' for ten seconds. the &lt;DelayLength&gt; can be also
a parameter of the type char(8).<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=7d32fc2b-dcb2-46ea-899a-fb5ea104688a" /></body>
      <title>Sleep in T-SQL (SQL Server 2005)</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,7d32fc2b-dcb2-46ea-899a-fb5ea104688a.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,7d32fc2b-dcb2-46ea-899a-fb5ea104688a.aspx</link>
      <pubDate>Tue, 06 Nov 2007 18:40:13 GMT</pubDate>
      <description>It took me a while (more than 15 minutes!) to find something so elementary. The thing is how to call a sleep function in T-SQL in SS2005. The statement is: Waitfor Delay &amp;lt;DelayLength&amp;gt;, where &amp;lt;DelayLength&amp;gt; can be in the format: '00:00:10' for ten seconds. the &amp;lt;DelayLength&amp;gt; can be also a parameter of the type char(8).&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=7d32fc2b-dcb2-46ea-899a-fb5ea104688a" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,7d32fc2b-dcb2-46ea-899a-fb5ea104688a.aspx</comments>
      <category>BI;BI/SQL Server 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=007d23dd-cf72-4096-8130-6bc2a0cc1783</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=007d23dd-cf72-4096-8130-6bc2a0cc1783</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As you can see from the title, we use VSS with AS 2005. The reason for this is that
we want to have backup and source control in our AS projects. There are some interesting
points when working that way which I would like to share:
</p>
        <ul>
          <li>
When you process a cube in a VSS-contolled AS project, the compiler writes the exact
time and hour of the last process in the .database file in the solution. This file
is a small and simple XML file. This piece of data is written in the &lt;LastProcessed&gt;
element. That is the reason why VSS will ask to check-out this file every time you
will process a cube. You can ignore it and cancel it twice and the cube will be processed
anyway. Of course, the last processing time will not be correct.</li>
          <li>
The .dwproj file is the binder of the solution (as in regular code project). That
means that Visual Studio will update this file every time you add, delete or rename an
object to the solutions. When two (or more) developers doing these king of actions
together it will cause a disaster. Only the objects of the developer who checked-in
last will be saved in the project. What you need to do is <strong>manually</strong> edit
this file and add the object's elements yourself. That's not very hard, but you'll
need to concentrate. As always, I recommend using Notepad++.</li>
          <li>
When editing the .cube file yourself (when merging manually after two developers worked
on the same cube), make sure that the dimensions ID's in the .cube file match
the ID in the .dim files.</li>
          <li>
AS projects can be easily destroyed because of an error in a VSS-related decision.
Think twice when clicking in its annoying dialog boxes. Make a label every day after
building, deploying and processing the project.</li>
        </ul>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=007d23dd-cf72-4096-8130-6bc2a0cc1783" />
      </body>
      <title>Working with Visual SourceSafe and Analysis Services 2005</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx</link>
      <pubDate>Mon, 29 Oct 2007 19:03:45 GMT</pubDate>
      <description>&lt;p&gt;
As you can see from the title, we use VSS with AS 2005. The reason for this is that
we want to have backup and source control in our AS projects. There are some interesting
points when working that way which I would like to share:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
When you process a cube in a VSS-contolled AS project, the compiler writes the exact
time and hour of the last process in the .database file in the solution. This file
is a small and simple XML file. This&amp;nbsp;piece of data is written in the &amp;lt;LastProcessed&amp;gt;
element. That is the reason why VSS will ask to check-out this file every time you
will process a cube. You can ignore it and cancel it twice and the cube will be processed
anyway. Of course, the last processing time will not be correct.&lt;/li&gt;
&lt;li&gt;
The .dwproj file is the binder of the solution (as in regular code project). That
means that Visual Studio will update this file every time you add, delete or rename&amp;nbsp;an
object to the solutions. When two (or more) developers doing these king of actions
together it will cause a disaster. Only the objects of the developer who checked-in
last will be saved in the project. What you need to do is &lt;strong&gt;manually&lt;/strong&gt; edit
this file and add the object's elements yourself. That's not very hard, but you'll
need to concentrate. As always, I recommend using Notepad++.&lt;/li&gt;
&lt;li&gt;
When editing the .cube file yourself (when merging manually after two developers worked
on the same cube), make sure that the&amp;nbsp;dimensions ID's in the .cube file match
the ID in the .dim files.&lt;/li&gt;
&lt;li&gt;
AS projects can be easily destroyed because of an error in a VSS-related decision.
Think twice when clicking in its annoying dialog boxes. Make a label every day after
building, deploying and processing the project.&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=007d23dd-cf72-4096-8130-6bc2a0cc1783" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,007d23dd-cf72-4096-8130-6bc2a0cc1783.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=b661daf6-f808-4406-9731-6391d9552b2b</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,b661daf6-f808-4406-9731-6391d9552b2b.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,b661daf6-f808-4406-9731-6391d9552b2b.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b661daf6-f808-4406-9731-6391d9552b2b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We use VSS with Analysis Services 2005 in order to have source control and backup
(I think this deserves a post of its own). We've been shocked to find out that our
VSS didn't save our labes and our versions. The defect we experienced is that after
clicking on the history button and then on the OK button in the "choose date range"
dialog box, nothing happened. We were sure that no history was saved and that is the
reason that nothing happened. After a long search in the web, I found <a href="http://forums.microsoft.com/msdn/showpost.aspx?postid=124591&amp;siteid=1&amp;sb=0&amp;d=1&amp;at=7&amp;ft=11&amp;tf=0&amp;pageid=1">this
thread</a> in the MSDN. The problem is a bug in VSS that has something to do with
dates representation in Microsoft's code. The workaround is easy, but it seems to
work only in Windows 2000: Open the VSS admin program, then Options -&gt; Tools -&gt;
TimeZone, and set the time zone as none. That's it.
</p>
        <p>
By the way, notice that my <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,229185d7-e921-482c-92b8-d73f51353375.aspx">second
post</a> in my blog was about date formats and how tricky and dangerous they can be.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b661daf6-f808-4406-9731-6391d9552b2b" />
      </body>
      <title>Visual SourceSafe history bug</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,b661daf6-f808-4406-9731-6391d9552b2b.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,b661daf6-f808-4406-9731-6391d9552b2b.aspx</link>
      <pubDate>Mon, 29 Oct 2007 18:43:05 GMT</pubDate>
      <description>&lt;p&gt;
We use VSS with Analysis Services 2005 in order to have source control and backup
(I think this deserves a post of its own). We've been shocked to find out that our
VSS didn't save our labes and our versions. The defect we experienced is that after
clicking on the history button and then on the OK button in the "choose date range"
dialog box, nothing happened. We were sure that no history was saved and that is the
reason that nothing happened. After a long search in the web, I found &lt;a href="http://forums.microsoft.com/msdn/showpost.aspx?postid=124591&amp;amp;siteid=1&amp;amp;sb=0&amp;amp;d=1&amp;amp;at=7&amp;amp;ft=11&amp;amp;tf=0&amp;amp;pageid=1"&gt;this
thread&lt;/a&gt; in the MSDN. The problem is a bug in VSS that has something to do with
dates representation in Microsoft's code. The workaround is easy, but it seems to
work only in Windows 2000: Open the VSS admin program, then Options -&amp;gt; Tools -&amp;gt;
TimeZone, and set the time zone as none. That's it.
&lt;/p&gt;
&lt;p&gt;
By the way, notice that my &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,229185d7-e921-482c-92b8-d73f51353375.aspx"&gt;second
post&lt;/a&gt; in my blog was about date formats and how tricky and dangerous they can be.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b661daf6-f808-4406-9731-6391d9552b2b" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,b661daf6-f808-4406-9731-6391d9552b2b.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is the second bug I found when working with AS and Oracle as my database (you
can read about the first one <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx">here</a>).
Some background about our Datawarehouse architecture before I begin to complain about
Microsoft:
</p>
        <p>
We cannot afford risking that our users will experience faults or crashes while
we refresh our DWH, process our cubes, etc. What we do to solve this problem is called
a switch: We have two schemas in our Oracle DB. While our users watch the first schema,
we update the other one. Only after we finish all our load process, we switch our
user's tools to see the data from the second schema. In order to implement this architecture
we use Oracle's synonyms. Let's say that the users watch the fact table "sales". We
have a synonym which is called sales_syn. While it's pointing to the first schema
(schema_a.sales_fact), we're loading into the second schema (schema_b.sales_fact).
After that, we switch the synonym so it will point to the second schema (schema_b).
The users always look on views that rely on synonyms. The views never change, only
the synonyms do.
</p>
        <p>
The problem starts when we make Named Queries in our Data Source Views in AS. Apparently,
AS looks inside the view that we enterd into the DSV, finds the target of the
synonym and saves it. Even after we make the switch (the synonym points on the other
schema), the named query will be pointing on the first one. All our efforts
to edit the named query have failed. When we open it again, we will always find that
the first schema is "burned" there and cannot be changed.
</p>
        <p>
The solution we chose is simply avoid using named queries. If we need a simple calculation
we can add a Named Calculation in the Data Source View and if we need a complex view
over our fact table, we write it ourself in the DB. This solutions breaks a little
bit the main point of the data source view (designated place for all the logic of
the DWH), but it is the best solution we could think of right now.
</p>
        <p>
Dear Microsoft developers - it seems that you tried to be smart and look into our
Oracle objects in order to enhance the multidimensional database's performance.
Next time, please think twice before you do.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea" />
      </body>
      <title>Analysis Services Named Queries and Oracle's synonyms serious bug</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea.aspx</link>
      <pubDate>Mon, 29 Oct 2007 18:24:36 GMT</pubDate>
      <description>&lt;p&gt;
This is the second bug I found when working with AS and Oracle as my database (you
can read about the first one &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx"&gt;here&lt;/a&gt;).
Some background about our Datawarehouse architecture before I begin to complain about
Microsoft:
&lt;/p&gt;
&lt;p&gt;
We cannot afford risking that our&amp;nbsp;users will experience faults or crashes&amp;nbsp;while
we refresh our DWH, process our cubes, etc. What we do to solve this problem is called
a switch: We have two schemas in our Oracle DB. While our users watch the first schema,
we update the other one. Only after we finish all our load process, we switch our
user's tools to see the data from the second schema. In order to implement this architecture
we use Oracle's synonyms. Let's say that the users watch the fact table "sales". We
have a synonym which is called sales_syn. While it's pointing to the first schema
(schema_a.sales_fact), we're loading into the second schema (schema_b.sales_fact).
After that, we switch the synonym so it will point to the second schema (schema_b).
The users always look on views that rely on synonyms. The views never change, only
the synonyms do.
&lt;/p&gt;
&lt;p&gt;
The problem starts when we make Named Queries in our Data Source Views in AS. Apparently,
AS looks inside the view that&amp;nbsp;we enterd into the DSV, finds the target of the
synonym and saves it. Even after we make the switch (the synonym points on the other
schema), the named query will&amp;nbsp;be pointing&amp;nbsp;on the first one. All our efforts
to edit the named query have failed. When we open it again, we will always find that
the first schema is "burned" there and cannot be changed.
&lt;/p&gt;
&lt;p&gt;
The solution we chose is simply avoid using named queries. If we need a simple calculation
we can add a Named Calculation in the Data Source View and if we need a complex view
over our fact table, we write it ourself in the DB. This solutions breaks a little
bit the main point of the data source view (designated place for all the logic of
the DWH), but it is the best solution we could think of right now.
&lt;/p&gt;
&lt;p&gt;
Dear Microsoft developers - it seems that you tried to be smart and look into our
Oracle objects in order to enhance the&amp;nbsp;multidimensional database's&amp;nbsp;performance.
Next time, please think twice before you do.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,dc7a85be-591a-42b6-83c9-4d6c5ef2d8ea.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=0ee6c819-dc0d-4801-a675-ceb967b17bb6</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0ee6c819-dc0d-4801-a675-ceb967b17bb6</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">This post is about Panorama because it
is the UI tool I'm working with, but this can be made with every BI UI tool.<br /><br />
My customer wanted to get the effect shown by Analysis Services 2005 when browsing
a dimension (see the picture below). He wanted to see some properties of the members
shown in the rows, along with the usual measures. Unfortunately, Panorama (and I'm
sure that also other tools) does not have this option in the GIU. The solution is
this code:<br /><br />
Create Member CurrentCube.[Measures].[MyProperty] as<br />
  iif(IsLeaf([MyDimension].[MyHierarchy].CurrentMember),<br />
     [MyDimension].[MyHierarchy].CurrentMember.Properties("MyProperty"),<br />
     Null)<br /><br />
Note that declaring only the third row will cause that every member that is not a
leaf will cause an error, which is something we don't want the viewer to see. If the
dimension has properties for members in other levels too, you can adjust this decleration.
This member can be declared either in the DataBase's Script (after the CALCULATE expression)
or inside the session/query (not recommended in Panorama). Now, all you have to do
is to show the dimension's members in the rows and this new measure in the columns
(after or before the regular measures), and you'll get what you want.<br /><p></p><img src="http://www.miky-schreiber.com/Blog/content/binary/memberProperties.JPG" border="0" /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0ee6c819-dc0d-4801-a675-ceb967b17bb6" /></body>
      <title>Showing Member Properties in Panorama</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</link>
      <pubDate>Sun, 30 Sep 2007 18:47:12 GMT</pubDate>
      <description>This post is about Panorama because it is the UI tool I'm working with, but this can be made with every BI UI tool.&lt;br&gt;
&lt;br&gt;
My customer wanted to get the effect shown by Analysis Services 2005 when browsing
a dimension (see the picture below). He wanted to see some properties of the members
shown in the rows, along with the usual measures. Unfortunately, Panorama (and I'm
sure that also other tools) does not have this option in the GIU. The solution is
this code:&lt;br&gt;
&lt;br&gt;
Create Member CurrentCube.[Measures].[MyProperty] as&lt;br&gt;
&amp;nbsp; iif(IsLeaf([MyDimension].[MyHierarchy].CurrentMember),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [MyDimension].[MyHierarchy].CurrentMember.Properties("MyProperty"),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null)&lt;br&gt;
&lt;br&gt;
Note that declaring only the third row will cause that every member that is not a
leaf will cause an error, which is something we don't want the viewer to see. If the
dimension has properties for members in other levels too, you can adjust this decleration.
This member can be declared either in the DataBase's Script (after the CALCULATE expression)
or inside the session/query (not recommended in Panorama). Now, all you have to do
is to show the dimension's members in the rows and this new measure in the columns
(after or before the regular measures), and you'll get what you want.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/memberProperties.JPG" border="0"&gt;&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0ee6c819-dc0d-4801-a675-ceb967b17bb6" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</comments>
      <category>BI;BI/MDX;BI/Panorama;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=c9a3aa65-47b5-4115-b68a-df6f19c6b4a0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,c9a3aa65-47b5-4115-b68a-df6f19c6b4a0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,c9a3aa65-47b5-4115-b68a-df6f19c6b4a0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c9a3aa65-47b5-4115-b68a-df6f19c6b4a0</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">My friend, Ilya, had a problem in SSIS.
He had a .csv file with too many commas. The meaning is that strings that started
and ended with inverted commas (") and had commas inside it were recognized by SSIS
as new column. For example, the row:<br />
"My name, is Miky", 200, 10 was recognised by SSIS as four columns instead of three.
Ilya wrote down a code for SSIS (in VB) that run before the package begin its work.
Here it is, hope it will help who ever seen this.<br /><br />
Imports System<br />
Imports System.Data<br />
Imports System.Math<br />
Imports Microsoft.SqlServer.Dts.Runtime<br />
Imports System.IO<br />
Imports System.Text<br />
Imports Microsoft.VisualBasic.FileIO<br />
Public Class ScriptMain<br />
Public Sub Main()<br />
  Dim csvFileFullPath As String<br />
  Dim tabFileFullPath As String<br />
  csvFileFullPath = Dts.Connections("Your CSV Connnection").ConnectionString<br />
  tabFileFullPath = Dts.Connections("Your Table Connection").ConnectionString<br />
  Using tabStreamWriter As New StreamWriter(tabFileFullPath, False, System.Text.Encoding.GetEncoding(1255))<br />
  Using csvFileReader As New StreamReader(csvFileFullPath, System.Text.Encoding.GetEncoding(1255),True)<br />
  Dim currentRow As String<br /><br />
  currentRow = csvFileReader.ReadLine()<br />
  tabStreamWriter.WriteLine(currentRow)<br />
  While Not csvFileReader.EndOfStream<br />
    Dim outputRow As New Text.StringBuilder()<br />
    Dim tmp, tmp1 as String<br />
    Dim offset as Int32 = 1<br />
    Dim beginS, endS As Int32<br /><br />
    beginS = 1<br />
    currentRow = csvFileReader.ReadLine()<br />
    beginS = InStr(offset, currentRow, """")<br />
    While Not beginS = 0 Or offset &gt; Len(currentRow)<br />
      endS = InStr(beginS+1, currentRow, """")<br />
      tmp = Mid(currentRow, beginS, endS - beginS)<br />
      tmp1 = Replace(tmp, ",", " ")<br />
      currentRow = Replace(currentRow, tmp, tmp1)<br />
      offset = endS + 1<br />
      beginS = InStr(offset, currentRow, """"")<br />
    End While<br />
    outputRow.Append(currentRow)<br />
    tabStreamWriter.WriteLine(outputRow.ToString())<br />
  End While<br />
End Using<br />
End Using<br />
Dts.TaskResult = Dts.Result.Success<br />
End Sub<br />
End Class<br /><br />
The solution here is to search for any comma (,) that is between two inverted commas
(") and replace it by space.<br />
Although it is a good solution, I would take another solution: Replace any comma by
special string, such as &amp;Miky&amp;, convert the csv file into table, and after
that go over that column(s) and replace any &amp;Miky&amp; by comma.<br /><br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c9a3aa65-47b5-4115-b68a-df6f19c6b4a0" /></body>
      <title>Fixing comma problem in CSV file in SSIS</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,c9a3aa65-47b5-4115-b68a-df6f19c6b4a0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,c9a3aa65-47b5-4115-b68a-df6f19c6b4a0.aspx</link>
      <pubDate>Mon, 24 Sep 2007 09:31:56 GMT</pubDate>
      <description>My friend, Ilya, had a problem in SSIS. He had a .csv file with too
many commas. The meaning is that strings that started and ended with
inverted commas (") and had commas inside it were recognized by SSIS as
new column. For example, the row:&lt;br&gt;
"My name, is Miky", 200, 10 was recognised by SSIS as four columns instead of three.
Ilya wrote down a code for SSIS (in VB) that run before the package begin its work.
Here it is, hope it will help who ever seen this.&lt;br&gt;
&lt;br&gt;
Imports System&lt;br&gt;
Imports System.Data&lt;br&gt;
Imports System.Math&lt;br&gt;
Imports Microsoft.SqlServer.Dts.Runtime&lt;br&gt;
Imports System.IO&lt;br&gt;
Imports System.Text&lt;br&gt;
Imports Microsoft.VisualBasic.FileIO&lt;br&gt;
Public Class ScriptMain&lt;br&gt;
Public Sub Main()&lt;br&gt;
&amp;nbsp; Dim csvFileFullPath As String&lt;br&gt;
&amp;nbsp; Dim tabFileFullPath As String&lt;br&gt;
&amp;nbsp; csvFileFullPath = Dts.Connections("Your CSV Connnection").ConnectionString&lt;br&gt;
&amp;nbsp; tabFileFullPath = Dts.Connections("Your Table Connection").ConnectionString&lt;br&gt;
&amp;nbsp; Using tabStreamWriter As New StreamWriter(tabFileFullPath, False, System.Text.Encoding.GetEncoding(1255))&lt;br&gt;
&amp;nbsp; Using csvFileReader As New StreamReader(csvFileFullPath, System.Text.Encoding.GetEncoding(1255),True)&lt;br&gt;
&amp;nbsp; Dim currentRow As String&lt;br&gt;
&lt;br&gt;
&amp;nbsp; currentRow = csvFileReader.ReadLine()&lt;br&gt;
&amp;nbsp; tabStreamWriter.WriteLine(currentRow)&lt;br&gt;
&amp;nbsp; While Not csvFileReader.EndOfStream&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim outputRow As New Text.StringBuilder()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim tmp, tmp1 as String&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim offset as Int32 = 1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim beginS, endS As Int32&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; beginS = 1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; currentRow = csvFileReader.ReadLine()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; beginS = InStr(offset, currentRow, """")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; While Not beginS = 0 Or offset &amp;gt; Len(currentRow)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endS = InStr(beginS+1, currentRow, """")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = Mid(currentRow, beginS, endS - beginS)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp1 = Replace(tmp, ",", " ")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentRow = Replace(currentRow, tmp, tmp1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; offset = endS + 1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; beginS = InStr(offset, currentRow, """"")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; End While&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; outputRow.Append(currentRow)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tabStreamWriter.WriteLine(outputRow.ToString())&lt;br&gt;
&amp;nbsp; End While&lt;br&gt;
End Using&lt;br&gt;
End Using&lt;br&gt;
Dts.TaskResult = Dts.Result.Success&lt;br&gt;
End Sub&lt;br&gt;
End Class&lt;br&gt;
&lt;br&gt;
The solution here is to search for any comma (,) that is between two inverted commas
(") and replace it by space.&lt;br&gt;
Although it is a good solution, I would take another solution: Replace any comma by
special string, such as &amp;amp;Miky&amp;amp;, convert the csv file into table, and after
that go over that column(s) and replace any &amp;amp;Miky&amp;amp; by comma.&lt;br&gt;
&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=c9a3aa65-47b5-4115-b68a-df6f19c6b4a0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,c9a3aa65-47b5-4115-b68a-df6f19c6b4a0.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a7fd1d19-64ca-493c-ba9b-9137583ff499</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a7fd1d19-64ca-493c-ba9b-9137583ff499.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a7fd1d19-64ca-493c-ba9b-9137583ff499.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a7fd1d19-64ca-493c-ba9b-9137583ff499</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I was asked how to get to SSIS log to see
how much time took for the package to run.<br />
Well, that depends.<br /><u>On Development:</u><br />
When developing new package, after running the process (click on the green arrow or
press F5) there's a new tab called Progress. Clicking it will show you everything
about the package's execution, including the time it started and the time it finished.<br /><br /><u>On Production:</u><br />
When developing the package, open the SSIS menu (Yes, there is a menu called as the
product's name. Microsoft...) and click on Logging... There, you can define logs for
your package. You can log in many ways: Writing to SQL sever, output file, XML file
and more. I recommend logging into SQL server and logging only the big and "hard"
parts in your data flow. In the Details tab, pick up only the exceptional events,
such as onError, onTaskFailed and onWarning. If you wish to know how much time took
for you package to run, also pick up onProgress.<br /><br />
Follow <a href="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/extran9/html/6f60cf93-35dc-431c-908d-2049c4ab66ba.htm">this
link</a> to read about every event in SSIS.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a7fd1d19-64ca-493c-ba9b-9137583ff499" /></body>
      <title>SSIS log and execution time</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a7fd1d19-64ca-493c-ba9b-9137583ff499.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a7fd1d19-64ca-493c-ba9b-9137583ff499.aspx</link>
      <pubDate>Sun, 09 Sep 2007 20:09:23 GMT</pubDate>
      <description>I was asked how to get to SSIS log to see how much time took for the package to run.&lt;br&gt;
Well, that depends.&lt;br&gt;
&lt;u&gt;On Development:&lt;/u&gt;
&lt;br&gt;
When developing new package, after running the process (click on the green arrow or
press F5) there's a new tab called Progress. Clicking it will show you everything
about the package's execution, including the time it started and the time it finished.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;On Production:&lt;/u&gt;
&lt;br&gt;
When developing the package, open the SSIS menu (Yes, there is a menu called as the
product's name. Microsoft...) and click on Logging... There, you can define logs for
your package. You can log in many ways: Writing to SQL sever, output file, XML file
and more. I recommend logging into SQL server and logging only the big and "hard"
parts in your data flow. In the Details tab, pick up only the exceptional events,
such as onError, onTaskFailed and onWarning. If you wish to know how much time took
for you package to run, also pick up onProgress.&lt;br&gt;
&lt;br&gt;
Follow &lt;a href="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/extran9/html/6f60cf93-35dc-431c-908d-2049c4ab66ba.htm"&gt;this
link&lt;/a&gt; to read about every event in SSIS.&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=a7fd1d19-64ca-493c-ba9b-9137583ff499" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a7fd1d19-64ca-493c-ba9b-9137583ff499.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=f0522178-c95d-46d6-81e5-0f753292b21f</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,f0522178-c95d-46d6-81e5-0f753292b21f.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,f0522178-c95d-46d6-81e5-0f753292b21f.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f0522178-c95d-46d6-81e5-0f753292b21f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">When designing a dimension in Analysis
Services, there's a funny button called Add Business Intelligence. Clicking it opens
a beautiful wizard which letting you define some basic properties of the dimension
such as ordering and enabling writeback. I'll take the writeback feature as an example:
When doing this using the wizard, it's taking you through many screen where all you
have to do except for clicking next, next is to check a checkbox in one of the screens.
That's it. After that, all this long wizard doing it setting a property called WriteEnabled
to True. I think that it's a strange software design of Microsoft. Maybe it's for
making the product seem more professional. You know - Add Business Intelligence sounds
like a heavy operation. Anyway, I don't know what they had in mind.<p></p><div align="center"><img src="http://www.miky-schreiber.com/Blog/content/binary/addBI.JPG" border="0" />     <img src="http://www.miky-schreiber.com/Blog/content/binary/enableWriteback.JPG" border="0" /></div><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f0522178-c95d-46d6-81e5-0f753292b21f" /></body>
      <title>Add Business Intelligence?</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,f0522178-c95d-46d6-81e5-0f753292b21f.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,f0522178-c95d-46d6-81e5-0f753292b21f.aspx</link>
      <pubDate>Sat, 14 Jul 2007 21:48:56 GMT</pubDate>
      <description>When designing a dimension in Analysis Services, there's a funny button
called Add Business Intelligence. Clicking it opens a beautiful wizard
which letting you define some basic properties of the dimension such as
ordering and enabling writeback. I'll take the writeback feature as an
example: When doing this using the wizard, it's taking you through many
screen where all you have to do except for clicking next, next is to
check a checkbox in one of the screens. That's it. After that, all this
long wizard doing it setting a property called WriteEnabled to True. I
think that it's a strange software design of Microsoft. Maybe it's for
making the product seem more professional. You know - Add Business
Intelligence sounds like a heavy operation. Anyway, I don't know what
they had in mind.&lt;p&gt;
&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/addBI.JPG" border="0"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/enableWriteback.JPG" border="0"&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=f0522178-c95d-46d6-81e5-0f753292b21f" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,f0522178-c95d-46d6-81e5-0f753292b21f.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a68059bf-fe59-48d5-a9e8-dd366e6a861c</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a68059bf-fe59-48d5-a9e8-dd366e6a861c.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a68059bf-fe59-48d5-a9e8-dd366e6a861c.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a68059bf-fe59-48d5-a9e8-dd366e6a861c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I never thought that I'll do a commercial
to Microsoft, but <a href="http://www.microsoft.com/sql/solutions/bi/projectreal.mspx">Project
Real</a> is a great thing that they did and they should get the credit for it. This
project is a full end-to-end BI solution, including ETLs (using SSIS), Analysis Services
cubes and mining modules, Reporting Services reports, end-user Panorama views and
more.<br /><br />
We work with Panorama as our main GUI tool to show our users the cube's data as tables,
charts, dashboards, etc, so this project is really helping us to learn how to implement
our project from the first ETL step all the way to the last Panorama step.<br /><br />
Recommended.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a68059bf-fe59-48d5-a9e8-dd366e6a861c" /></body>
      <title>Project Real</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a68059bf-fe59-48d5-a9e8-dd366e6a861c.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a68059bf-fe59-48d5-a9e8-dd366e6a861c.aspx</link>
      <pubDate>Sat, 14 Jul 2007 21:05:54 GMT</pubDate>
      <description>I never thought that I'll do a commercial to Microsoft, but &lt;a href="http://www.microsoft.com/sql/solutions/bi/projectreal.mspx"&gt;Project
Real&lt;/a&gt; is a great thing that they did and they should get the credit for it. This
project is a full end-to-end BI solution, including ETLs (using SSIS), Analysis Services
cubes and mining modules, Reporting Services reports, end-user Panorama views and
more.&lt;br&gt;
&lt;br&gt;
We work with Panorama as our main GUI tool to show our users the cube's data as tables,
charts, dashboards, etc, so this project is really helping us to learn how to implement
our project from the first ETL step all the way to the last Panorama step.&lt;br&gt;
&lt;br&gt;
Recommended.&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=a68059bf-fe59-48d5-a9e8-dd366e6a861c" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a68059bf-fe59-48d5-a9e8-dd366e6a861c.aspx</comments>
      <category>BI;BI/Panorama;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2005/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=e36d9c69-b16d-4d4b-bea9-05e3a5d02729</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e36d9c69-b16d-4d4b-bea9-05e3a5d02729</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the data source view, when you edit the SQL by yourself (right click on the
table in the data source view, Replace table -&gt; With new named query) be careful
when using Oracle DB tables. When writing in the SQL the Oracle's table name with
small casing, the SQL parser will add commas to the table name, making the SQL not
work because the Oracle does not recognize this table name (with the commas).
</p>
        <p>
Solution: Enter the table name with big casing, which will make the parser leave the
table name as is. Also, remember: when creating or editing a named query always check
and syntax, but also run the query and check that you get the desirable result before
hitting the OK and saving the new named query.
</p>
        <p>
by the way, I wonder: what were we doing if the Oracle was case sensitive?
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e36d9c69-b16d-4d4b-bea9-05e3a5d02729" />
      </body>
      <title>Analysis Services using Oracle bug</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx</link>
      <pubDate>Thu, 31 May 2007 20:36:37 GMT</pubDate>
      <description>&lt;p&gt;
In the data source view, when you edit the SQL by yourself&amp;nbsp;(right click on the
table in the data source view, Replace table -&amp;gt;&amp;nbsp;With new named query) be careful
when using Oracle DB tables. When writing in the SQL the Oracle's table name with
small casing, the SQL parser will add commas to the table name, making the SQL not
work because the Oracle does not recognize this table name (with the commas).
&lt;/p&gt;
&lt;p&gt;
Solution: Enter the table name with big casing, which will make the parser leave the
table name as is. Also, remember: when creating or editing a named query always check
and syntax, but also run the query and check that you get the desirable result before
hitting the OK and saving the new named query.
&lt;/p&gt;
&lt;p&gt;
by the way, I wonder: what&amp;nbsp;were we&amp;nbsp;doing if the Oracle was case sensitive?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=e36d9c69-b16d-4d4b-bea9-05e3a5d02729" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,e36d9c69-b16d-4d4b-bea9-05e3a5d02729.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=396609a8-c65f-4579-a5be-623c0c4953cf</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,396609a8-c65f-4579-a5be-623c0c4953cf.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,396609a8-c65f-4579-a5be-623c0c4953cf.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=396609a8-c65f-4579-a5be-623c0c4953cf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Few months ago we were given an assignment to copy/move all our DTSs that were
running with SQL Server 2000 to the new SQL Server 2005 Integration Services (SSIS).
My friend Michael did it and wrote some important notes that he discovered when building
ETLs with Integration Services. I decided to list them here because they are important
and useful, especially for those who haven't got the time to develop with SSIS so
far.
</p>
        <ul>
          <li>
One of the greatest improvements in SSIS is that between the source and the destination
of the ETL process you can do many things, such as making new fields, sorting, converting
data types, union all between different sources, implement your logic on a field,
and much more. This is much easier than ever because all you need to do is to
add a block to the data flow task and define it for your purposes. 
</li>
          <li>
SSIS ships with a tool for migrating SQL Server 2000 DTSs. Do not use this tool. Sometimes
the result of the conversion is not good enough and in all cases you can't edit the
new migrated data task. 
</li>
          <li>
When making a connection to a non-Microsoft DB, such as Oracle, use OLE DB client
instead of the out-of-fashion ODBC. 
</li>
          <li>
When the destination field is shorter (string type) than the source, add a data conversion
block and cut the string. Otherwise, there will be an annoying warning even if the
truncation is wanted. 
</li>
          <li>
In many times (when working with non-Microsoft providers) the automatic recognition
of the length &amp; types of the source fields is not correct. Enter the source block
and edit these properties by yourself. 
</li>
          <li>
When moving a Unicode field (data type DT_WSTR) to a non-Unicode destination
field (DT_STR), a data conversion block is required. 
</li>
          <li>
SQL Server 2000 Stored Procedures will work in SSIS, but the Linked Servers definitions
are problematic. Consider another options rather than using linked servers. 
</li>
          <li>
When the source/destination is a CSV file, use Flat File Connection. But if it is
an Excel file (.xls), use a Microsoft Jet OLE DB connection and define the source
as OLE DB Source (yes, it will work with Excel files).</li>
        </ul>
        <p>
Again, thanks for Michael for making and sharing these notes.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=396609a8-c65f-4579-a5be-623c0c4953cf" />
      </body>
      <title>First meeting with Integration Services</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,396609a8-c65f-4579-a5be-623c0c4953cf.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,396609a8-c65f-4579-a5be-623c0c4953cf.aspx</link>
      <pubDate>Thu, 31 May 2007 20:17:10 GMT</pubDate>
      <description>&lt;p&gt;
Few months ago we were given an assignment to copy/move all&amp;nbsp;our DTSs that were
running with SQL Server 2000 to the new SQL Server 2005 Integration Services (SSIS).
My friend Michael did it and wrote some important notes that he discovered when building
ETLs with Integration Services. I decided to list them here because they are important
and useful, especially for those who haven't got the time to develop with SSIS so
far.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
One of the greatest improvements in SSIS is that between the source and the destination
of the ETL process you can do many things, such as making new fields, sorting, converting
data types, union all between different sources, implement your logic on a field,
and much more. This is much&amp;nbsp;easier than ever because all you need to do is to
add a block to the data flow task and define it for your purposes. 
&lt;li&gt;
SSIS ships with a tool for migrating SQL Server 2000 DTSs. Do not use this tool. Sometimes
the result of the conversion is not good enough and in all cases you can't edit the
new migrated data task. 
&lt;li&gt;
When making a connection to a non-Microsoft DB, such as Oracle, use OLE DB client
instead of the out-of-fashion ODBC. 
&lt;li&gt;
When the destination field is shorter (string type) than the source, add a data conversion
block and cut the string. Otherwise, there will be an annoying warning even if the
truncation is wanted. 
&lt;li&gt;
In many times (when working with non-Microsoft providers) the automatic recognition
of the length &amp;amp; types of the source fields is not correct. Enter the source block
and edit these properties by yourself. 
&lt;li&gt;
When&amp;nbsp;moving a Unicode field (data type DT_WSTR) to a non-Unicode destination
field (DT_STR), a data conversion block is required. 
&lt;li&gt;
SQL Server 2000 Stored Procedures will work in SSIS, but the Linked Servers definitions
are problematic. Consider another options&amp;nbsp;rather than using linked servers. 
&lt;li&gt;
When the source/destination is a CSV file, use Flat File Connection. But if it is
an Excel file (.xls), use a Microsoft Jet OLE DB connection and define the source
as OLE DB Source&amp;nbsp;(yes, it will work with Excel files).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Again, thanks for Michael for making and sharing these notes.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=396609a8-c65f-4579-a5be-623c0c4953cf" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,396609a8-c65f-4579-a5be-623c0c4953cf.aspx</comments>
      <category>BI;BI/SQL Server 2005;BI/SQL Server 2005/Integration Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
For some weeks we were fighting with (or against?) the Panorama software in order
to make it work right and show a nice pilot of BI dashboard screen to our managers.
After three weeks we managed to show a good opening position by building a nice dashboard
screen including a map, graphs, gauges and crosstabs.
</p>
        <p>
I found that the installation of the SQL Server and the Panorama server was not good
enough in my company, so I decided to try it for myself. The installation of the SQL
Server is quite easy (Next, Next, Next ...), but installing the Panorama server is
a complicated process. Paying attention to so many small details, knowing and remembering
what to do inside the Windows server, IIS, Windows services, Windows registry and
more is not so easy. Finally, after two days I managed to do this. Now I know that
some things in the installation in my work place were not so good and I can point
them out.
</p>
        <p>
You can see the exciting (for me, at least) result in this picture, as it is a nice
dashboard taken from my screen. Many posts about Panorama and SQL Server 2005 will
come ahead. Now I can relax - Panorama is on the way...
</p>
        <p>
          <img src="http://www.miky-schreiber.com/Blog/content/binary/pan.JPG" border="0" />
        </p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0" />
      </body>
      <title>Finally, working</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0.aspx</link>
      <pubDate>Thu, 31 May 2007 19:09:10 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
For some weeks we were fighting with (or against?) the Panorama software in order
to make it work right and show a nice pilot of BI dashboard screen to our managers.
After three weeks we managed to show a good opening position by building a nice dashboard
screen including a map, graphs, gauges and crosstabs.
&lt;/p&gt;
&lt;p&gt;
I found that the installation of the SQL Server and the Panorama server was not good
enough in my company, so I decided to try it for myself. The installation of the SQL
Server is quite easy (Next, Next, Next ...), but installing the Panorama server is
a complicated process. Paying attention to so many small details, knowing and remembering
what to do inside the Windows server, IIS, Windows services, Windows registry&amp;nbsp;and
more is not so easy. Finally, after two days I managed to do this. Now I know that
some things in the installation in my work place were not so good and I can point
them out.
&lt;/p&gt;
&lt;p&gt;
You can see the exciting (for me, at least) result in this picture, as it is a nice
dashboard taken from my screen. Many posts about Panorama and SQL Server 2005 will
come ahead. Now I can relax - Panorama is on the way...
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/pan.JPG" border=0&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,b31ff5e3-1617-4e01-a9fc-a2d2cd5cacd0.aspx</comments>
      <category>BI;BI/Panorama;BI/SQL Server 2005</category>
    </item>
  </channel>
</rss>