<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Lookup Pattern: Range Lookups</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx</link><description>Performing range lookups (i.e. to find a key for a given range) is a common ETL operation in data warehousing scenarios. It's especially for historical loads and late arriving fact situations, where you're using type 2 dimensions and you need to locate</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Lookup Patterns</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9142439</link><pubDate>Tue, 25 Nov 2008 20:33:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9142439</guid><dc:creator>SSIS Team Blog</dc:creator><description>&lt;p&gt;From the Lookup presentation I put together for the MS BI conference in October, here is a series of&lt;/p&gt;
</description></item><item><title>Processing late arriving facts in SSIS</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9142459</link><pubDate>Tue, 25 Nov 2008 20:41:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9142459</guid><dc:creator>SSIS Team Blog</dc:creator><description>&lt;p&gt;This is just a place holder. Please see the post on different approaches of doing Range Lookups in SSIS&lt;/p&gt;
</description></item><item><title>Learn more about Lookup and its new features: A compilation</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9340894</link><pubDate>Tue, 20 Jan 2009 01:22:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9340894</guid><dc:creator>Douglas Laudenschlager</dc:creator><description>&lt;p&gt;The SQL Server Integration Services team added valuable new caching options (and scalability) to the&lt;/p&gt;
</description></item><item><title>Explanation of the Script component code - Urgent</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9853529</link><pubDate>Thu, 30 Jul 2009 19:50:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9853529</guid><dc:creator>ravisharvindMSBI</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can anybody explain in brief the code used in the script component?&lt;/p&gt;
&lt;p&gt;I have a scenario to implement the same.&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated. Thanks&lt;/p&gt;
</description></item><item><title>re: Lookup Pattern: Range Lookups</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9853688</link><pubDate>Thu, 30 Jul 2009 22:44:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9853688</guid><dc:creator>mmasson</dc:creator><description>&lt;p&gt;Which part do you need explained?&lt;/p&gt;
</description></item><item><title>Explanation of the Script component code</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9855340</link><pubDate>Sat, 01 Aug 2009 23:47:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9855340</guid><dc:creator>ravisharvindMSBI</dc:creator><description>&lt;p&gt;Basically the part within the while loop.&lt;/p&gt;
&lt;p&gt;Why is StartDate not considered in the code?&lt;/p&gt;
&lt;p&gt;I am a starter, so please bear with me.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
</description></item><item><title>re: Lookup Pattern: Range Lookups</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9856410</link><pubDate>Mon, 03 Aug 2009 21:00:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9856410</guid><dc:creator>mmasson</dc:creator><description>&lt;p&gt;An optimization. It assumes that everything up to the next end date belongs to the previous record.&lt;/p&gt;
&lt;p&gt;ex. &lt;/p&gt;
&lt;p&gt;Key 1, EndDate 2001/01/01&lt;/p&gt;
&lt;p&gt;Key 20, EndDate 2003/01/01&lt;/p&gt;
&lt;p&gt;Key 40, EndDate 2008/01/01&lt;/p&gt;
&lt;p&gt;Key 60, EndDate NULL&lt;/p&gt;
&lt;p&gt;If a record with a transaction date of 1999 comes in, we can determine it belongs to Key 1. If a record with a transaction date of 2004 comes in, we know it belongs to Key 40. &lt;/p&gt;
&lt;p&gt;Note, this will only work if there are no gaps in your history. It assumes that your data has been cleaned before hand. &lt;/p&gt;
</description></item><item><title>Error Redirection</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9877384</link><pubDate>Thu, 20 Aug 2009 21:55:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9877384</guid><dc:creator>ravisharvindMSBI</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How do i redirect the lookup no match output in the script component if there is no dimension natural key available?&lt;/p&gt;
&lt;p&gt;Can you please help me out with the code?&lt;/p&gt;
&lt;p&gt;Thanks in advance for the help.&lt;/p&gt;
</description></item><item><title>Error Redirection - Urgent</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9881791</link><pubDate>Sun, 23 Aug 2009 18:19:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9881791</guid><dc:creator>ravisharvindMSBI</dc:creator><description>&lt;p&gt;How do i redirect the lookup no match output in the script component if there is no dimension natural key available?&lt;/p&gt;
&lt;p&gt;Even if redirection is not possible i would like to replace the corresponding key of the record like 1, which is the key for default record in my dimension?&lt;/p&gt;
&lt;p&gt;waiting for your response...&lt;/p&gt;
</description></item><item><title>re: Lookup Pattern: Range Lookups</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9882704</link><pubDate>Mon, 24 Aug 2009 17:41:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9882704</guid><dc:creator>mmasson</dc:creator><description>&lt;p&gt;You can redirect with the script by adding another output to the component.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.sqlservercentral.com/articles/Integration+Services+"&gt;http://www.sqlservercentral.com/articles/Integration+Services+&lt;/a&gt;(SSIS)/66136/&lt;/p&gt;
&lt;p&gt;Alternatively, you can replace the key value with 1 instead of throwing an exception like the script does now.&lt;/p&gt;
</description></item><item><title>Not Working</title><link>http://blogs.msdn.com/mattm/archive/2008/11/25/lookup-pattern-range-lookups.aspx#9882848</link><pubDate>Mon, 24 Aug 2009 21:06:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9882848</guid><dc:creator>ravisharvindMSBI</dc:creator><description>&lt;p&gt;Hi Masson,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I tried replacing the key for the corresponding row to 1 instead of throwing the exception as you said. But it fails again. I don't want the script component to fail at any cost, just replace the key with 1 and proceed.&lt;/p&gt;
&lt;p&gt;Below is the change I made to the code.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (ranges == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Row.ProductKey = 1;&lt;/p&gt;
&lt;p&gt;//commented&lt;/p&gt;
&lt;p&gt;//throw new NullReferenceException(&amp;quot;Couldn't find //value for product number &amp;quot; + productNumber);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Am I missing something here or should I do anything else.. Please have a look at it. It is very critical for me.&lt;/p&gt;
</description></item></channel></rss>