<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>dev</title>
	<atom:link href="http://dev.diditho.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.diditho.net</link>
	<description>my chalk board {asp,net , c#,php, sql, gis, sharepoint, mdx, bi, dm and etc ...}</description>
	<pubDate>Fri, 18 Jul 2008 09:47:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Kill a lock process</title>
		<link>http://dev.diditho.net/2008/07/18/18/</link>
		<comments>http://dev.diditho.net/2008/07/18/18/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 05:57:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/?p=18</guid>
		<description><![CDATA[The last method (workaround) to solve a lock status is by killing the process. Write this line to Kill a process in sql server:

1
2
3
4
--This example shows how to terminate SPID 55.
KILL 55
--This example generates a status of the rollback process for the specific spid.
KILL 55 WITH STATUSONLY

&#8211;This is the progress report.
spid 55: Transaction rollback in [...]]]></description>
			<content:encoded><![CDATA[<p>The last method (workaround) to solve a lock status is by killing the process. Write this line to Kill a process in sql server:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="sql"><span style="color: #808080; font-style: italic;">--This example shows how to terminate SPID 55.</span>
<span style="color: #993333; font-weight: bold;">KILL</span> <span style="color: #cc66cc;">55</span>
<span style="color: #808080; font-style: italic;">--This example generates a status of the rollback process for the specific spid.</span>
<span style="color: #993333; font-weight: bold;">KILL</span> <span style="color: #cc66cc;">55</span> <span style="color: #993333; font-weight: bold;">WITH</span> STATUSONLY</pre></td></tr></table></div>

<p>&#8211;This is the progress report.<br />
spid 55: Transaction rollback in progress. Estimated rollback completion: 70% Estimated time left: 15 seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/07/18/18/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multiple IIf Logic Block</title>
		<link>http://dev.diditho.net/2008/06/25/multiple-iif-logic-block/</link>
		<comments>http://dev.diditho.net/2008/06/25/multiple-iif-logic-block/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 10:30:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mdx]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/?p=17</guid>
		<description><![CDATA[IIf function often used in MultiDimensionalExpression (MDX), It&#8217;s quiet simple to implement single block of IIf block.
This an example of Multiple IIf logic block.
Example1:

1
2
3
4
IIf&#40;Measures.&#91;Store Sales&#93; &#62; 50000, &#34;Good&#34;,
IIf&#40;Measures.&#91;Store Sales&#93; &#62; 30000, &#34;Average&#34;,
IIf&#40;Measures.&#91;Store Sales&#93; &#62; 10000, &#34;Poor&#34;,
&#34;No&#34;&#41;&#41;&#41;

]]></description>
			<content:encoded><![CDATA[<p><strong>IIf</strong> function often used in MultiDimensionalExpression (MDX), It&#8217;s quiet simple to implement single block of IIf block.</p>
<p>This an example of Multiple <strong>IIf </strong>logic block.</p>
<p>Example1:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="sql">IIf<span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Store Sales<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">50000</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;Good&quot;</span><span style="color: #66cc66;">,</span>
IIf<span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Store Sales<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">30000</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;Average&quot;</span><span style="color: #66cc66;">,</span>
IIf<span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Store Sales<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;Poor&quot;</span><span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">&quot;No&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/06/25/multiple-iif-logic-block/feed/</wfw:commentRss>
		</item>
		<item>
		<title>If&#8230;Then..Else&#8230; in MultiDimensionalExpression</title>
		<link>http://dev.diditho.net/2008/06/25/ifthenelse-in-multidimensionalexpression/</link>
		<comments>http://dev.diditho.net/2008/06/25/ifthenelse-in-multidimensionalexpression/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 02:15:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mdx]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/?p=16</guid>
		<description><![CDATA[A logical script in MDX to perform an &#8220;If..Then.. Else..&#8221; block.

1
IIf&#40;«Logical Expression», «Numeric/String Expression1», «Numeric/String Expression2»&#41;

Example1:The following example returns 0 if Measures.CurrentMember is an empty cell, 1 otherwise:

1
IIf&#40;IsEmpty&#40;Measures.CurrentMember&#41;, 0, 1&#41;

Example2:The following string returns the string &#8220;Yes&#8221; if Measures.CurrentMember is an empty cell, the string, &#8220;No&#8221; otherwise:

1
IIf&#40;IsEmpty&#40;Measures.CurrentMember&#41;, &#34;Yes&#34;, &#34;No&#34;&#41;

Example3:

1
2
3
4
5
IIf&#40;
&#91;Scenario&#93;.CurrentMember IS &#91;Scenario&#93;.&#91;Budget&#93;,
     &#91;Measures&#93;.&#91;Budget [...]]]></description>
			<content:encoded><![CDATA[<p>A logical script in MDX to perform an &#8220;If..Then.. Else..&#8221; block.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql">IIf<span style="color: #66cc66;">&#40;</span>«Logical Expression»<span style="color: #66cc66;">,</span> «Numeric<span style="color: #66cc66;">/</span>String Expression1»<span style="color: #66cc66;">,</span> «Numeric<span style="color: #66cc66;">/</span>String Expression2»<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Example1:The following example returns 0 if Measures.CurrentMember is an empty cell, 1 otherwise:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql">IIf<span style="color: #66cc66;">&#40;</span>IsEmpty<span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span>CurrentMember<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Example2:The following string returns the string &#8220;Yes&#8221; if Measures.CurrentMember is an empty cell, the string, &#8220;No&#8221; otherwise:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql">IIf<span style="color: #66cc66;">&#40;</span>IsEmpty<span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span>CurrentMember<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;Yes&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;No&quot;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Example3:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql">IIf<span style="color: #66cc66;">&#40;</span>
<span style="color: #66cc66;">&#91;</span>Scenario<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>CurrentMember <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #66cc66;">&#91;</span>Scenario<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Budget<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span>
     <span style="color: #66cc66;">&#91;</span>Measures<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Budget Unit Sold<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span>
     <span style="color: #66cc66;">&#91;</span>Measures<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>ActualUnit Sold<span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Example4:Average Sales (Measure) By Time Day (Dimension)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="sql">IIf <span style="color: #66cc66;">&#40;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>currentmember<span style="color: #66cc66;">.</span>level<span style="color: #66cc66;">.</span>name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;(All)&quot;</span>   <span style="color: #993333; font-weight: bold;">OR</span>
<span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>currentmember<span style="color: #66cc66;">.</span>level<span style="color: #66cc66;">.</span>name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Year&quot;</span>     <span style="color: #993333; font-weight: bold;">OR</span>
<span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>currentmember<span style="color: #66cc66;">.</span>level<span style="color: #66cc66;">.</span>name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Quarter&quot;</span>  <span style="color: #993333; font-weight: bold;">OR</span>
<span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>currentmember<span style="color: #66cc66;">.</span>level<span style="color: #66cc66;">.</span>name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Month&quot;</span>    <span style="color: #993333; font-weight: bold;">OR</span>
<span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span>currentmember<span style="color: #66cc66;">.</span>level<span style="color: #66cc66;">.</span>name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Day&quot;</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>AVG<span style="color: #66cc66;">&#40;</span>Descendants<span style="color: #66cc66;">&#40;</span>Time<span style="color: #66cc66;">.</span>CurrentMember<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Day<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Sales<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Source:</p>
<p>SQL Server 2000 Book Online (F1)</p>
<p>MDX Solution With Microsoft SQL Server Analysis Service (Wiley) (George Spofford)</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/06/25/ifthenelse-in-multidimensionalexpression/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Relative Contribution to Total Value (Percentage)</title>
		<link>http://dev.diditho.net/2008/06/24/relative-contribution-to-total-value-percentage/</link>
		<comments>http://dev.diditho.net/2008/06/24/relative-contribution-to-total-value-percentage/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 12:16:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mdx]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/?p=15</guid>
		<description><![CDATA[There&#8217;s a few scenario to calculate a percentage of a measure in OLAP CUBE (Analysis Service 2000). A Percentage is common calculation in MDX , and it can be solved by divide a measure to  total value (Grand Total).
Sample 1:Measures.[Value Contribution to Total]:

1
&#40;Measures.&#91;Value&#93; / &#40;Measures.&#91;Value&#93;, Time.&#91;ALL Time&#93;, Products.&#91;ALL Products&#93;,…&#41;

Sample 2:Measures.[Value Contribution to Total]:

1
&#40;Measures.&#91;Value&#93; / &#40;Measures.&#91;Value&#93;, [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a few scenario to calculate a percentage of a measure in OLAP CUBE (Analysis Service 2000). A Percentage is common calculation in MDX , and it can be solved by divide a measure to  total value (Grand Total).</p>
<p>Sample 1:Measures.[Value Contribution to Total]:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql"><span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> Time<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">ALL</span> Time<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> Products<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">ALL</span> Products<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span>…<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Sample 2:Measures.[Value Contribution to Total]:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql"><span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> Products<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">ALL</span> Products<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span>Warehouses<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">ALL</span> Warehouses<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Sample 3:Measures.[Product Contribution to Total Products]:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql"><span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">,</span> Products<span style="color: #66cc66;">.</span>CurrentMember<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span>Measures<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Value<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> Products<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">ALL</span> Products<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Source:</p>
<blockquote><p><a href="http://technet.microsoft.com/en-us/library/aa902652(SQL.80).aspx">MSDN</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/06/24/relative-contribution-to-total-value-percentage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Encrypt and Decrypt Web.Config (Connection Strings, etc) from ASP Page</title>
		<link>http://dev.diditho.net/2008/05/13/encrypt-and-decrypt-webconfig-connection-strings-etc-from-asp-page/</link>
		<comments>http://dev.diditho.net/2008/05/13/encrypt-and-decrypt-webconfig-connection-strings-etc-from-asp-page/#comments</comments>
		<pubDate>Tue, 13 May 2008 09:29:33 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/2008/05/13/encrypt-and-decrypt-webconfig-connection-strings-etc-from-asp-page/</guid>
		<description><![CDATA[Example:
How to encrypt/decrypt connectionStrings and SessionState section on Web.Config file?
This is a codebehid sample script written on C# to perform Encrypt and Decrypt procedure against few items on Web.Config file. Single ASP.NET page can perform this task easily, so you don&#8217;t have to write any code in command prompt.

Declare this namespace:

1
2
3
using System.Web;
using System.Web.Configuration;
using System.Web.Security;

The code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
private [...]]]></description>
			<content:encoded><![CDATA[<p>Example:</p>
<p>How to encrypt/decrypt <em><strong>connectionStrings</strong></em> and <em><strong>SessionState</strong></em> section on <strong><em>Web.Config</em></strong> file?</p>
<p>This is a codebehid sample script written on C# to perform Encrypt and Decrypt procedure against few items on Web.Config file. Single ASP.NET page can perform this task easily, so you don&#8217;t have to write any code in command prompt.</p>
<p><span id="more-13"></span></p>
<p>Declare this namespace:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="csharp"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.Configuration</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.Security</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>The code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="csharp">...
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> ProtectSection<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> sectionName,<span style="color: #FF0000;">string</span> provider<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
Configuration config <span style="color: #008000;">=</span> WebConfigurationManager.<span style="color: #0000FF;">OpenWebConfiguration</span><span style="color: #000000;">&#40;</span>Request.<span style="color: #0000FF;">ApplicationPath</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
ConfigurationSection section <span style="color: #008000;">=</span> config.<span style="color: #0000FF;">GetSection</span><span style="color: #000000;">&#40;</span>sectionName<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
     <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>section <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span> <span style="color: #008000;">&amp;&amp;</span> <span style="color: #008000;">!</span>section.<span style="color: #0000FF;">SectionInformation</span>.<span style="color: #0000FF;">IsProtected</span><span style="color: #000000;">&#41;</span>
     <span style="color: #000000;">&#123;</span>
     section.<span style="color: #0000FF;">SectionInformation</span>.<span style="color: #0000FF;">ProtectSection</span><span style="color: #000000;">&#40;</span>provider<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     config.<span style="color: #0000FF;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> UnProtectSection<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> sectionName<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
Configuration config <span style="color: #008000;">=</span> WebConfigurationManager.<span style="color: #0000FF;">OpenWebConfiguration</span><span style="color: #000000;">&#40;</span>Request.<span style="color: #0000FF;">ApplicationPath</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
ConfigurationSection section <span style="color: #008000;">=</span> config.<span style="color: #0000FF;">GetSection</span><span style="color: #000000;">&#40;</span>sectionName<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
     <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>section <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span> <span style="color: #008000;">&amp;&amp;</span> section.<span style="color: #0000FF;">SectionInformation</span>.<span style="color: #0000FF;">IsProtected</span><span style="color: #000000;">&#41;</span>
     <span style="color: #000000;">&#123;</span>
     section.<span style="color: #0000FF;">SectionInformation</span>.<span style="color: #0000FF;">UnprotectSection</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     config.<span style="color: #0000FF;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
...</pre></td></tr></table></div>

<p>Note that there&#8217;s two string variable to be fill</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp"><span style="color: #FF0000;">string</span> sectionName<span style="color: #008080; font-style: italic;">//can be any section on your web.config (connectionstrings,system.web/sessionState ,etc...)</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp"><span style="color: #FF0000;">string</span> Provider <span style="color: #008080; font-style: italic;">//can be any provider available (DataProtectionConfigurationProvider, etc...)</span></pre></td></tr></table></div>

<p>This method need identity impersonate setting set to &#8220;true&#8221; in Web.Config file. In this case i&#8217;m using domain user (coz all my dev server under domain controller).</p>

<div class="wp_syntax"><div class="code"><pre class="csharp">...
&nbsp;
<span style="color: #008000;">&lt;</span> identity impersonate<span style="color: #008000;">=</span><span style="color: #666666;">&quot;true&quot;</span> userName<span style="color: #008000;">=</span><span style="color: #666666;">&quot;DOMAIN<span style="color: #008080; font-weight: bold;">\u</span>ser&quot;</span> password<span style="color: #008000;">=</span><span style="color: #666666;">&quot;pass&quot;</span> <span style="color: #008000;">/&gt;;</span>
&nbsp;
...</pre></div></div>

<p>After performing Encrypting and Decrypting method, you should delete the <em><strong>page</strong></em> and <em><strong>identity impersonate</strong></em> section in <em><strong>web.config</strong></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/13/encrypt-and-decrypt-webconfig-connection-strings-etc-from-asp-page/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web GIS with MapGuide Opensource 1.2</title>
		<link>http://dev.diditho.net/2008/05/12/web-gis-with-mapguide-opensource-12/</link>
		<comments>http://dev.diditho.net/2008/05/12/web-gis-with-mapguide-opensource-12/#comments</comments>
		<pubDate>Mon, 12 May 2008 13:05:37 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/?p=3</guid>
		<description><![CDATA[I found that the simple and low cost way to setup, produce, run and maintain a Web Geographic Information System (GIS) is by using MapGuide Opensource (server) and Autodesk MapGuide Studio (Author).
Screen shot Note: The spatial data is based on esri shape file (shp) and automatically transform into sdf (autodesk spatial data file) for better [...]]]></description>
			<content:encoded><![CDATA[<p>I found that the simple and low cost way to setup, produce, run and maintain a Web Geographic Information System (GIS) is by using MapGuide Opensource (server) and Autodesk MapGuide Studio (Author).</p>
<p>Screen shot Note: The spatial data is based on esri shape file (shp) and automatically transform into sdf (autodesk spatial data file) for better performance. The Image layer is from NASA.</p>
<p>The spatial layer can also easily join with other data source such as SQL Server, Oracle, MySQl , PostgreSQL , etc</p>
<p>Here&#8217;s the screen shots, from authoring until publishing:</p>
<p>1. Find Data and Build Layers</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:cb88afcb-8149-45e1-b5c0-d718dd00f9c8" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh5.ggpht.com/didithoe/SCgzQNsQ7DI/AAAAAAAABBs/PnUkt95eX4g/s400/1.membuat%20peta%201.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh5.ggpht.com/didithoe/SCgzQNsQ7DI/AAAAAAAABBs/PnUkt95eX4g/s400/1.membuat%20peta%201.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>2.Make Map and Place The Map on the Internet</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:506da137-587a-443d-a1f3-c83f66a30dcc" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh5.ggpht.com/didithoe/SCgzQNsQ7EI/AAAAAAAABB0/3vQ4LqeUWxE/s400/2.membuat%20peta%202.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh5.ggpht.com/didithoe/SCgzQNsQ7EI/AAAAAAAABB0/3vQ4LqeUWxE/s400/2.membuat%20peta%202.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>3.Line feature, it connect all the dot.</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:a440461d-2168-4357-9889-5c9966fc4af6" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh6.ggpht.com/didithoe/SCgzQdsQ7FI/AAAAAAAABB8/2Kx2bCctN-I/s400/3.layers%201.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh6.ggpht.com/didithoe/SCgzQdsQ7FI/AAAAAAAABB8/2Kx2bCctN-I/s400/3.layers%201.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>4.It quickly load(show) millions of polygon shapes</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:c3b0527d-13b0-4349-abb9-23bb7d853231" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh6.ggpht.com/didithoe/SCgzQdsQ7GI/AAAAAAAABCE/fP-chGg5KZ8/s400/4.layers%202.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh6.ggpht.com/didithoe/SCgzQdsQ7GI/AAAAAAAABCE/fP-chGg5KZ8/s400/4.layers%202.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>5. image from NASA and transparant layer</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:531c8e11-2b1e-4f21-a88f-cf0240e624c3" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh6.ggpht.com/didithoe/SCgzQdsQ7HI/AAAAAAAABCM/sD-scyt5_8I/s400/5.raster%20dan%20transparat%20polygon.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh6.ggpht.com/didithoe/SCgzQdsQ7HI/AAAAAAAABCM/sD-scyt5_8I/s400/5.raster%20dan%20transparat%20polygon.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>6. Buffer</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:c3918c98-95d9-4bc1-afba-e52ad035e48b" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://lh3.ggpht.com/didithoe/SCgzUtsQ7II/AAAAAAAABCU/yy8aczl8Klk/s400/6.buffer.jpg"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh3.ggpht.com/didithoe/SCgzUtsQ7II/AAAAAAAABCU/yy8aczl8Klk/s400/6.buffer.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>7. An Image from a click on a location, using simple concat script</p>
<div id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:074bcce4-5636-4858-b5ed-c765c3284d28" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><a href="http://picasaweb.google.com/didithoe/DevStuuf"><img style="border-right: 2px; border-top: 2px; border-left: 2px; border-bottom: 2px" src="http://lh4.ggpht.com/didithoe/SCgzU9sQ7JI/AAAAAAAABCc/ZpdXL28rc6E/s400/7.popup%20information.jpg" alt="" width="400" height="300" /></a></p>
</div>
<p>The Web GIS application is runnning on windows server 2003 operating system, dot net 2.0 framework , mapguide opensource 1.2 and Autodesk MapGuide Studio</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/12/web-gis-with-mapguide-opensource-12/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sharepoint Service 3.0 and SharePoint Portal 2003 BUG!</title>
		<link>http://dev.diditho.net/2008/05/12/sharepoint-service-30-and-sharepoint-portal-2003-bug/</link>
		<comments>http://dev.diditho.net/2008/05/12/sharepoint-service-30-and-sharepoint-portal-2003-bug/#comments</comments>
		<pubDate>Mon, 12 May 2008 13:01:16 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/2008/05/12/sharepoint-service-30-and-sharepoint-portal-2003-bug/</guid>
		<description><![CDATA[In my opinion, Sharepoint Portal Server 2003 (SPS 2003) is a superb! Content Management System (CMS) and Collaboration Portal for Intranet. It&#8217;s build (runs) on top of Windows Sharepoint Service 2.0 (WSS 2.0). It&#8217;s very suitable for Knowledge Management. You can throw almost any kind of document, collaborate and find it again just a second.
BUT [...]]]></description>
			<content:encoded><![CDATA[<p>In my opinion, Sharepoint Portal Server 2003 (SPS 2003) is a superb! Content Management System (CMS) and Collaboration Portal for Intranet. It&#8217;s build (runs) on top of Windows Sharepoint Service 2.0 (WSS 2.0). It&#8217;s very suitable for Knowledge Management. You can throw almost any kind of document, collaborate and find it again just a second.</p>
<p>BUT NOW, there are few annoying BUG!</p>
<p>Usually , Installing service pack for WSS 2.0 and SPS 2003 is a very easy task and without a problem. BUT there&#8217;s unexpected side effect when Intalling WSS 2.0 Service Pack 3.0 and SPS 2003 Service Pack 3.0. Suddenly <strong>Rich Text Editor </strong>feature<strong> </strong>in<strong> Content Editor </strong>webpart<strong> </strong>didn&#8217;t work.</p>
<p>There&#8217;s an<strong> IE Script Error</strong> with message that says <strong>&#8216;Cannot open the Rich Text Editor&#8217;</strong>. It occurs on Internet Explorer 6 (IE 6) and IE 7. Both on Windows Vista and Windows XP.</p>
<p>After googling from diffrent source there&#8217;s a solution for part of the problem (NOT ALL THE PROBLEM!!):</p>
<p><strong>First, modify the &#8220;Server Side&#8221;</strong></p>
<p>Step 1: Edit<strong> &#8220;ows.js&#8221;</strong> file (back up first)</p>
<blockquote><p>Path: <strong>C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033</strong></p>
<p>look for the this method: <strong>PortalPinToMyPage</strong></p>
<p>After this insert following javascript code:</p>
<p>function RenderActiveX(str)<br />
{</p>
<p>document.write(str);<br />
}</p></blockquote>
<p>Step 2:Edit<strong> &#8220;htmledit.aspx&#8221;</strong> file (back up first)</p>
<p>Path:C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033\htmledit.aspx</p>
<p>Insert the following script (again&#8230;)</p>
<blockquote><p>function RenderActiveX(str)<br />
{</p>
<p>document.write(str);<br />
}</p></blockquote>
<p>to this &#8220;<strong>&lt;script LANGUAGE=&#8221;JavaScript&#8221;&gt;</strong>&#8221; section,  so it looks like this:</p>
<blockquote><p>&lt;script LANGUAGE=&#8221;JavaScript&#8221;&gt;<br />
<strong>function RenderActiveX(str)<br />
{<br />
document.write(str);<br />
}<br />
</strong>RenderActiveX(&#8221;&lt;object ID=tbContentElement CLASS=tbContentElement CLASSID=&#8217;clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A&#8217; style=visibility:hidden VIEWASTEXT&gt;&lt;param name=Scrollbars value=true&gt;&lt;/object&gt;&#8221;);<br />
RenderActiveX(&#8221;&lt;object id=ObjTableInfo classid=&#8217;clsid:47B0DFC7-B7A3-11D1-ADC5-006008A5848C&#8217; style=visibility:hidden  viewastext&gt;&lt;/object&gt;&#8221;);<br />
RenderActiveX(&#8221;&lt;object id=ObjBlockFormatInfo classid=&#8217;clsid:8D91090E-B955-11D1-ADC5-006008A5848C&#8217; style=visibility:hidden viewastext&gt;&lt;/object&gt;&#8221;);<br />
&lt;/script&gt;</p></blockquote>
<p>Step 3:  reset the web server</p>
<p>goto command prompt console, and type:<strong>iisreset</strong></p>
<p><strong>Second, modify the &#8220;Client Side&#8221;</strong></p>
<p>In some cases, we do not have to modify the client side. But sometimes we have to&#8230;</p>
<blockquote><p>Step 1:Open The web browser  (Internet Explorer 6 or IE 7), in this case i&#8217;m using IE  7.</p>
<p>Step 2: Open Tools &gt; Internet options &gt; Security &gt; Local Intranet</p>
<p>Step 3: Click &#8220;Sites&#8221; &gt; &#8220;Advanced&#8221;</p>
<p>Step 4: At &#8220;Add This Website to the zone&#8221; section, Fill the blank column with SPS 2003 Portal Address (ie:http://10.11.1.10,)</p>
<p>Step 5: Click &#8220;Add&#8221; &gt; &#8220;Close&#8221; &gt; &#8220;Ok&#8221; &gt; &#8220;Ok&#8221;</p></blockquote>
<p>Done!</p>
<p>Note: This only work on windows XP, haven&#8217;t found any workaround for Windows Vista :-(</p>
<p>That&#8217;s why i said that it cannot solve all the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/12/sharepoint-service-30-and-sharepoint-portal-2003-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MapGuide Open Source (MGOS)</title>
		<link>http://dev.diditho.net/2008/05/12/mapguide-open-source-mgos/</link>
		<comments>http://dev.diditho.net/2008/05/12/mapguide-open-source-mgos/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:59:45 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/2008/05/12/mapguide-open-source-mgos/</guid>
		<description><![CDATA[I always looking for free web gis server with dotnet framework capabilities. Mostly everything that related with dotnet came with a charge. Recently i found that autodesk start their web gis opensource project, the MapGuide Open Source Project (MGOS). Surely it can run on dotnet framework and it&#8217;s free. 
MapGuide Open Source is a web-based [...]]]></description>
			<content:encoded><![CDATA[<p>I always looking for free web <a href="http://gis.com/">gis</a> server with <a href="http://asp.net/">dotnet framework</a> capabilities. Mostly everything that related with dotnet came with a charge. Recently i found that <a href="http://autodesk.com/">autodesk</a> start their web gis opensource project, the <a href="https://mapguide.osgeo.org/">MapGuide Open Source</a> Project (MGOS). Surely it can run on dotnet framework and it&#8217;s free. </p>
<blockquote><p><em>MapGuide Open Source is a web-based platform that enables users to quickly develop and deploy web mapping applications and geospatial web services. MapGuide features an interactive viewer that includes support for feature selection, property inspection, map tips, and operations such as buffer, select within, and measure. MapGuide includes an XML database for managing content, and supports most popular geospatial file formats, databases, and standards. MapGuide can be deployed on Linux or Windows, supports Apache and IIS web servers, and offers extensive PHP, .NET, Java, and JavaScript APIs for application development. MapGuide Open Source is licensed under the LGPL..</em> </p>
</blockquote>
<p><a href="https://mapguide.osgeo.org/downloads.html">Free Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/12/mapguide-open-source-mgos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sharpmap</title>
		<link>http://dev.diditho.net/2008/05/12/sharpmap/</link>
		<comments>http://dev.diditho.net/2008/05/12/sharpmap/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:58:13 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/2008/05/12/sharpmap/</guid>
		<description><![CDATA[One of my favorite geographic Information System (gis) web server is Sharpmap. It runs on dotnet 2.0 and using ASP.NET(C#) language. I like Sharmap, because it&#8217;s open source and free . The web server it self didn&#8217;t need any additional software/component to install. Just pure dotnetframework (v.2.0). So it can be easily deploy on common [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite geographic Information System (gis) web server is<a href="http://www.codeplex.com/SharpMap"> Sharpmap</a>. It runs on dotnet 2.0 and using <a href="http://asp.net/">ASP.NET(C#)</a> language. I like Sharmap, because it&#8217;s open source and free . The web server it self didn&#8217;t need any additional software/component to install. Just pure dotnetframework (v.2.0). So it can be easily deploy on common IIS web server equip with dotnetframeork.     <br />Sadly, <a href="http://sharpgis.net/">Morten</a> which is the main developer of sharpmap had to decide not to involve on the project anymore, just when the project began to bloom. Morten working on <a href="http://esri.com/">ESRI</a> California at the ADF Team now. </p>
<p><a href="http://www.codeplex.com/SharpMap/Release/ProjectReleases.aspx">Free Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/12/sharpmap/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multi Dimensional Expression Basic (MDX)</title>
		<link>http://dev.diditho.net/2008/05/12/multi-dimensional-expression-basic-mdx/</link>
		<comments>http://dev.diditho.net/2008/05/12/multi-dimensional-expression-basic-mdx/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:56:58 +0000</pubDate>
		<dc:creator>diditho</dc:creator>
		
		<category><![CDATA[mdx]]></category>

		<guid isPermaLink="false">http://dev.diditho.net/2008/05/12/multi-dimensional-expression-basic-mdx/</guid>
		<description><![CDATA[This post is copy from http://gumper.com, a unique website coz it&#8217;s only have one item&#8230;. 
The basic script of Multi Dimensional Expression (MDX). It&#8217;s very usefull for developer to build some scenarios in a CUBE.
thank you,
hope it&#8217;s ok i copied all the page.







MDX Expressions


Function
Requires
Returns


CurrentMember
Dimension
Member


PrevMember
Member
Member


NextMember
Member
Member


Lag
Numeric Expression
Member


Lead
Numeric Expression
Member


ParallelPeriod
Level, numeric expression, member
Member


PeriodsToDate
Level, member
Set


YTD
Member
Set


MTD
Member
Set


Sum
Set, numeric expression
Number






&#160;






Navigating the Hierarchy


Function
Requires
Returns


Parent
Member
Member


Children
Member
Set


FirstChild
Member
Member


LastChild
Member
Member


Descendants
Member, level [...]]]></description>
			<content:encoded><![CDATA[<p>This post is copy from <a href="http://gumper.com">http://gumper.com</a>, a unique website coz it&#8217;s only have one item&#8230;. </p>
<p>The basic script of Multi Dimensional Expression (MDX). It&#8217;s very usefull for developer to build some scenarios in a CUBE.</p>
<p>thank you,</p>
<p>hope it&#8217;s ok i copied all the page.</p>
<table>
<tbody>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">MDX Expressions</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>CurrentMember</td>
<td>Dimension</td>
<td>Member</td>
</tr>
<tr>
<td>PrevMember</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>NextMember</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>Lag</td>
<td>Numeric Expression</td>
<td>Member</td>
</tr>
<tr>
<td>Lead</td>
<td>Numeric Expression</td>
<td>Member</td>
</tr>
<tr>
<td>ParallelPeriod</td>
<td>Level, numeric expression, member</td>
<td>Member</td>
</tr>
<tr>
<td>PeriodsToDate</td>
<td>Level, member</td>
<td>Set</td>
</tr>
<tr>
<td>YTD</td>
<td>Member</td>
<td>Set</td>
</tr>
<tr>
<td>MTD</td>
<td>Member</td>
<td>Set</td>
</tr>
<tr>
<td>Sum</td>
<td>Set, numeric expression</td>
<td>Number</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">Navigating the Hierarchy</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>Parent</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>Children</td>
<td>Member</td>
<td>Set</td>
</tr>
<tr>
<td>FirstChild</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>LastChild</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>Descendants</td>
<td>Member, level or member, distance</td>
<td>Set</td>
</tr>
<tr>
<td>Ancestor</td>
<td>Member, level or member, distance</td>
<td>Member</td>
</tr>
<tr>
<td>Siblings</td>
<td>Member</td>
<td>Set</td>
</tr>
<tr>
<td>FirstSibling</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>LastSibling</td>
<td>Member</td>
<td>Member</td>
</tr>
<tr>
<td>Cousin</td>
<td>Member, ancestor member</td>
<td>Member</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">Data Analysis</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>Sum</td>
<td>Set, numeric expression</td>
<td>Number</td>
</tr>
<tr>
<td>Count</td>
<td>Set</td>
<td>Integer</td>
</tr>
<tr>
<td>Avg</td>
<td>Set, numeric expression</td>
<td>Number</td>
</tr>
<tr>
<td>Tail</td>
<td>Set, count</td>
<td>Set</td>
</tr>
<tr>
<td>Item</td>
<td>Set, index number</td>
<td>Member</td>
</tr>
<tr>
<td>OpeningPeriod</td>
<td>Level, member</td>
<td>Member</td>
</tr>
<tr>
<td>ClosingPeriod</td>
<td>Level, member</td>
<td>Member</td>
</tr>
<tr>
<td>Max</td>
<td>Set, numeric expression</td>
<td>Number</td>
</tr>
<tr>
<td>Min</td>
<td>Set, numeric expression</td>
<td>Number</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">Moving Averages</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>Level</td>
<td>Member</td>
<td>Level</td>
</tr>
<tr>
<td>Members</td>
<td>Level or dimension</td>
<td>Setr</td>
</tr>
<tr>
<td>Iif</td>
<td>Condition, what to do if true, what to do if false</td>
<td>Number or string</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">Filters</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>Filter</td>
<td>Set, condition</td>
<td>Set</td>
</tr>
<tr>
<td>IsEmpty</td>
<td>Expression</td>
<td>Boolean</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="3">Member Properties</th>
</tr>
<tr>
<th align="left">Function</th>
<th align="left">Requires</th>
<th align="left">Returns</th>
</tr>
<tr>
<td>Properties</td>
<td>Member name</td>
<td>String</td>
</tr>
<tr>
<td>Val <i>(VBA Function)</i></td>
<td>String</td>
<td>Numeric value</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th colspan="2">Aggregates</th>
</tr>
<tr>
<th align="left">Aggregate function</th>
<th align="left">Returned value</th>
</tr>
<tr>
<td>Sum</td>
<td>The sum of the input values</td>
</tr>
<tr>
<td>Min</td>
<td>The lowest of the input values</td>
</tr>
<tr>
<td>Max</td>
<td>The highest of the input values</td>
</tr>
<tr>
<td>Count</td>
<td>The number of input values</td>
</tr>
<tr>
<td>Distinct Count</td>
<td>The number of unique input values</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" align="left" border="1">
<tbody>
<tr>
<th>Example MDX Calculations</th>
</tr>
<tr>
<th>Sales Growth</th>
</tr>
<tr>
<td align="left">
<pre>([Time].CurrentMember, [Measures].[Sales])
- ([Time].CurrentMember.PrevMember, [Measures].[Sales])</pre>
</td>
</tr>
<tr>
<th>PP Growth</th>
</tr>
<tr>
<td align="left">
<pre>([Time].CurrentMember, [Measures].[Sales])
- (ParellelPeriod(Year, 1, [Time].CurrentMember), [Measures].[Sales])</pre>
</td>
</tr>
<tr>
<th>YTD Sales</th>
</tr>
<tr>
<td align="left">
<pre>sum(ytd([Time].CurrentMember), [Measures].[Sales])</pre>
</td>
</tr>
<tr>
<th>YTD Sales Using PeriodsToDate</th>
</tr>
<tr>
<td align="left">
<pre>sum(PeriodsToDate([Time].[Year], [Time].CurrentMember), [Measures].[Sales])</pre>
</td>
</tr>
<tr>
<th>Product Percentage</th>
</tr>
<tr>
<td align="left">
<pre>([Product].CurrentMember, [Measures].[Unit Sales])
/ ([Product].CurrentMember.Parent, [Measures].[Unit Sales]) * 100</pre>
</td>
</tr>
<tr>
<th>Product Total Percentage</th>
</tr>
<tr>
<td align="left">
<pre>([Product].CurrentMember, [Measures].[Unit Sales])
/ ([Product].[All Products], [Measures].[Unit Sales]) * 100</pre>
</td>
</tr>
<tr>
<th>Average Stock - Brute Force</th>
</tr>
<tr>
<td align="left">
<pre>Sum(Descendants([Time].CurrentMember, [Month]), [Measures].[Quantity])
/ Count(Descendants([Time].CurrentMember, [Month]))</pre>
</td>
</tr>
<tr>
<th>Average Stock - Elegant</th>
</tr>
<tr>
<td align="left">
<pre>Avg(Descendants([Time].CurrentMember, [Month]), [Measures].[Quantity])</pre>
</td>
</tr>
<tr>
<th>Closing Period - Brute Force</th>
</tr>
<tr>
<td align="left">
<pre>(Tail(Descendants([Time].CurrentMember, [Month]), 1).Item(0), [Measures].[Quantity])</pre>
</td>
</tr>
<tr>
<th>Closing Period - Elegant</th>
</tr>
<tr>
<td align="left">
<pre>(ClosingPeriod([Month], [Time].CurrentMember), [Measures].[Quantity])</pre>
</td>
</tr>
<tr>
<th>Max for Period</th>
</tr>
<tr>
<td align="left">
<pre>Max(Descendants([Time].CurrentMember, [Month]), [Measures].[Quantity])</pre>
</td>
</tr>
<tr>
<th>Min for Period</th>
</tr>
<tr>
<td align="left">
<pre>Min(Descendants([Time].CurrentMember, [Month]), [Measures].[Quantity])</pre>
</td>
</tr>
<tr>
<th>Moving Average</th>
</tr>
<tr>
<td align="left">
<pre>Avg([Time].CurrentMember.Lag(2):[Time].CurrentMember, [Measures].[Unit Sales])</pre>
</td>
</tr>
<tr>
<th>Products Down</th>
</tr>
<tr>
<td align="left">
<pre>Count(Filter(Descendants([Product].CurrentMember, [Product Name])
            , ([Time].CurrentMember, [Measures].[Unit Sales])
              &lt; ([Time].CurrentMember.PrevMember, [Measures].[Unit Sales])))
/
Count(Descendants([Product].CurrentMember, [Product Name]))</pre>
</td>
</tr>
<tr>
<th>Dynamic Custom Default Member</th>
</tr>
<tr>
<td align="left">
<pre>Tail(Filter([Time].[Month].Members
     , Not IsEmpty([Time].CurrentMember)), 1).Item(0)</pre>
</td>
</tr>
<tr>
<th>Properties Query</th>
</tr>
<tr>
<td align="left">
<pre>Filter([Store].[Store Name].Members
       , Val([Store].CurrentMember.Properties(&quot;Store Sqft&quot;)) &lt; 21000)</pre>
</td>
</tr>
<tr>
<th>Products Down Query</th>
</tr>
<tr>
<td align="left">
<pre>select
    {{{[Measures].[Products Down]}
      * {[Customers].DefaultMember}
      * {[Product].DefaultMember}}} on columns
    , {[Time].&amp;[1998].&amp;[Q1].&amp;[1]
       , [Time].&amp;[1998].&amp;[Q1].&amp;[2]
       , [Time].&amp;[1998].&amp;[Q1].&amp;[3]
       , [Time].&amp;[1998].&amp;[Q2].&amp;[4]
       , [Time].&amp;[1998].&amp;[Q2].&amp;[5]
       , [Time].&amp;[1998].&amp;[Q2].&amp;[6]
       , [Time].&amp;[1998].&amp;[Q3].&amp;[7]
       , [Time].&amp;[1998].&amp;[Q3].&amp;[8]
       , [Time].&amp;[1998].&amp;[Q3].&amp;[9]
       , [Time].&amp;[1998].&amp;[Q4].&amp;[10]
       , [Time].&amp;[1998].&amp;[Q4].&amp;[11]} on rows
from
    [Sales_MDX2]  </pre>
</td>
</tr>
<tr>
<th>MDX Query</th>
</tr>
<tr>
<td align="left">
<pre>select
    {[Measures].[Unit Sales]
     , [Measures].[MA]} on columns
    , {Descendants([Time].[Year].&amp;[1997], [Month])} on rows
from
    [Sales_MDX2]</pre>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://dev.diditho.net/2008/05/12/multi-dimensional-expression-basic-mdx/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
