<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using a PARTITION BY JOIN to Fill In The Gaps</title>
	<atom:link href="http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/</link>
	<description>Delivered Intelligence</description>
	<lastBuildDate>Mon, 15 Mar 2010 14:12:52 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dhaval</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-10238</link>
		<dc:creator>Dhaval</dc:creator>
		<pubDate>Mon, 13 Jul 2009 23:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-10238</guid>
		<description>Hi Stevart, 

We also had same requirment to determine weekend between given 2 dates, we did it something like below. 
OWB expersion can be used to write CASE statement. It uses standard weekend ( sat and Sun) 

SELECT promo_id,
       promo_name,
       promo_subcategory,
       promo_begin_date,
       promo_end_date,
       promo_end_date-promo_begin_date
    +
    (CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#039;D&#039;)) = 7 THEN 0 ELSE TO_NUMBER(TO_CHAR(promo_begin_date,&#039;D&#039;)) enD 
  - CASE WHEN TO_NUMBER(TO_CHAR(promo_end_date,&#039;D&#039;)) = 7 THEN 0 ELSE TO_NUMBER(TO_CHAR(promo_end_date,&#039;D&#039;)) enD )/7 * 2 
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#039;D&#039;)) = 7 THEN 2 ELSE 0 enD 
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#039;D&#039;)) = 1 THEN 1 ELSE 0 enD 
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_end_date,&#039;D&#039;)) = 7 THEN -1 ELSE 0 enD  ) diff_excluding_WEEKENDs
FROM sh.promotions;</description>
		<content:encoded><![CDATA[<p>Hi Stevart, </p>
<p>We also had same requirment to determine weekend between given 2 dates, we did it something like below.<br />
OWB expersion can be used to write CASE statement. It uses standard weekend ( sat and Sun) </p>
<p>SELECT promo_id,<br />
       promo_name,<br />
       promo_subcategory,<br />
       promo_begin_date,<br />
       promo_end_date,<br />
       promo_end_date-promo_begin_date<br />
    +<br />
    (CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#8217;D')) = 7 THEN 0 ELSE TO_NUMBER(TO_CHAR(promo_begin_date,&#8217;D')) enD<br />
  &#8211; CASE WHEN TO_NUMBER(TO_CHAR(promo_end_date,&#8217;D')) = 7 THEN 0 ELSE TO_NUMBER(TO_CHAR(promo_end_date,&#8217;D')) enD )/7 * 2<br />
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#8217;D')) = 7 THEN 2 ELSE 0 enD<br />
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_begin_date,&#8217;D')) = 1 THEN 1 ELSE 0 enD<br />
  + CASE WHEN TO_NUMBER(TO_CHAR(promo_end_date,&#8217;D')) = 7 THEN -1 ELSE 0 enD  ) diff_excluding_WEEKENDs<br />
FROM sh.promotions;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9278</link>
		<dc:creator>Jeff Moss</dc:creator>
		<pubDate>Mon, 27 Apr 2009 19:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9278</guid>
		<description>My experience is both extensive and limited, in different senses...I&#039;ve been dealing with DW type systems since 1998, but only two major systems during that period and each has involved only &quot;savvy&quot; SQL developers...who ensure that any new arrival on the team is aware of the &quot;set based&quot; approaches, design patterns and other key features of the &quot;way we do things&quot; on the DW, before they are let loose!

;-)

We tried, admittedly with v9 of OWB, to use the hints capabilities inside OWB...and it was a nightmare...which was another nail in the coffin of it&#039;s usage at the time. I don&#039;t know if that part of the product has &quot;moved on&quot; but if it hasn&#039;t then I&#039;m not sure I&#039;d agree as to it&#039;s ease of use...whatever the case, it simply can&#039;t be as easy as adding them to the SQL in a view.

As I said, we&#039;ve reached a point now where we&#039;re just upgrading to 10gR2 of OWB and therefore perhaps, being on a recent release, we&#039;ll be able to reassess our position over the coming period. I&#039;m looking forward to that.

Cheers
Jeff</description>
		<content:encoded><![CDATA[<p>My experience is both extensive and limited, in different senses&#8230;I&#8217;ve been dealing with DW type systems since 1998, but only two major systems during that period and each has involved only &#8220;savvy&#8221; SQL developers&#8230;who ensure that any new arrival on the team is aware of the &#8220;set based&#8221; approaches, design patterns and other key features of the &#8220;way we do things&#8221; on the DW, before they are let loose!</p>
<p>;-)</p>
<p>We tried, admittedly with v9 of OWB, to use the hints capabilities inside OWB&#8230;and it was a nightmare&#8230;which was another nail in the coffin of it&#8217;s usage at the time. I don&#8217;t know if that part of the product has &#8220;moved on&#8221; but if it hasn&#8217;t then I&#8217;m not sure I&#8217;d agree as to it&#8217;s ease of use&#8230;whatever the case, it simply can&#8217;t be as easy as adding them to the SQL in a view.</p>
<p>As I said, we&#8217;ve reached a point now where we&#8217;re just upgrading to 10gR2 of OWB and therefore perhaps, being on a recent release, we&#8217;ll be able to reassess our position over the coming period. I&#8217;m looking forward to that.</p>
<p>Cheers<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stewart Bryson</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9270</link>
		<dc:creator>Stewart Bryson</dc:creator>
		<pubDate>Mon, 27 Apr 2009 13:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9270</guid>
		<description>@Peter
be my guest :)

@Jeff
&gt;...I can’t see anyone developing on a warehouse without being a proficient SQL developer...

I wish that were the case... but not always. When an organization dives into creating their first data warehouse, the developers familiar with the source systems quite often get the call... and they may be OLTP-style developers without advanced analytic and aggregate SQL ability. Some of these developers may not even have experience writing complex joins, as it&#039;s not done in the source systems they are used to. I find that OWB forces some of these developers to write complex set-based processes, where, left to their own devices, they may revert to cursor-based PL/SQL.

&gt; ...hints... gets a bit tricky if it’s all inside OWB...
Actually, using hints in OWB (if you are so inclined) is quite easy. Just Configure the mapping, and there you go.

&gt; What about debugging?
OWB has a debugger that&#039;s not too bad. And, in versions 10.2.0.4 and 11g, showing incoming and outgoing SQL from a particular operator is easy... just as easy as if the code were in a view. And you can always trace it as well.</description>
		<content:encoded><![CDATA[<p>@Peter<br />
be my guest :)</p>
<p>@Jeff<br />
&gt;&#8230;I can’t see anyone developing on a warehouse without being a proficient SQL developer&#8230;</p>
<p>I wish that were the case&#8230; but not always. When an organization dives into creating their first data warehouse, the developers familiar with the source systems quite often get the call&#8230; and they may be OLTP-style developers without advanced analytic and aggregate SQL ability. Some of these developers may not even have experience writing complex joins, as it&#8217;s not done in the source systems they are used to. I find that OWB forces some of these developers to write complex set-based processes, where, left to their own devices, they may revert to cursor-based PL/SQL.</p>
<p>&gt; &#8230;hints&#8230; gets a bit tricky if it’s all inside OWB&#8230;<br />
Actually, using hints in OWB (if you are so inclined) is quite easy. Just Configure the mapping, and there you go.</p>
<p>&gt; What about debugging?<br />
OWB has a debugger that&#8217;s not too bad. And, in versions 10.2.0.4 and 11g, showing incoming and outgoing SQL from a particular operator is easy&#8230; just as easy as if the code were in a view. And you can always trace it as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petr Schmidt</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9228</link>
		<dc:creator>Petr Schmidt</dc:creator>
		<pubDate>Thu, 23 Apr 2009 22:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9228</guid>
		<description>Interesting discussion re OWB viability...we are in the process of replacing OWB with custom PL/SQL transform modules at one of our client&#039;s DW implementations. Aside from experiencing similar constraints as Jeff&#039;s team we are also finding that maintenance of complex OWB maps can be quite time-consuming (relative to hand-written SQL) especially if significant map restructuring is required. I should note that we have a very experienced Oracle development group and only small portion of the DW was developed using OWB. I can appreciate OWB attractiveness as a pretty complete ETL platform for installations looking to get an Oracle DW initiative started.

Petr</description>
		<content:encoded><![CDATA[<p>Interesting discussion re OWB viability&#8230;we are in the process of replacing OWB with custom PL/SQL transform modules at one of our client&#8217;s DW implementations. Aside from experiencing similar constraints as Jeff&#8217;s team we are also finding that maintenance of complex OWB maps can be quite time-consuming (relative to hand-written SQL) especially if significant map restructuring is required. I should note that we have a very experienced Oracle development group and only small portion of the DW was developed using OWB. I can appreciate OWB attractiveness as a pretty complete ETL platform for installations looking to get an Oracle DW initiative started.</p>
<p>Petr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9219</link>
		<dc:creator>Jeff Moss</dc:creator>
		<pubDate>Thu, 23 Apr 2009 08:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9219</guid>
		<description>Hi Peter

Completely agree that there is no &quot;always true&quot; answer...I guess the article someone needs to write is one that debates the reasoning behind either choice...I&#039;ve thought about doing that myself, but I haven&#039;t got the time at the minute.

Yes, that&#039;s why we&#039;re considering the &quot;inside OWB&quot; route going forwards...the documentation reasoning....but I&#039;m not necessarily sure that the documentation is meaningful per se.

Yes, I&#039;d have a &quot;pretty picture&quot; but unless I train the end users, they wouldn&#039;t be able to understand it any more than they can looking inside the view - for the more complex mappings - easy ones perhaps. The developers would be able to use it, but I can&#039;t see anyone developing on a warehouse without being a proficient SQL developer...and, in my experience at least, they&#039;d much rather write a view than paint pretty pictures.

I know from experience on the current implementation I&#039;m working on, that the code falls into 30% simple views and 70% complicated views buckets and consequently, for the majority of mappings, only the &quot;exceptional developers&quot; will be able to make use of that documentation - not that that&#039;s a bad thing of course.

The more complex it is, the more likely I&#039;d want to write it in SQL, rather than build it inside OWB...adding that to the fact that it&#039;s easier to develop using one approach rather than two, that then leads me to writing everything in views rather than OWB. Your mileage, as they say, may vary.

If you then start talking automatically generating code, is it easier to generate the complex SQL for views and simple OMB mappings using OMBPlus, or use OMBPlus to generate all of it? I&#039;d suggest the former since use of the less widely known OMBPlus, is minimal then.

What about tuning? You build a complex mapping and deploy it...it doesn&#039;t run right due to a bad plan, so you need to tune it...there are, of course, a number of ways to tackle that...but if your method of choice is adding hints, then that, from my understanding, gets a bit tricky if it&#039;s all inside OWB...but very simple if it&#039;s a view. Of course using hints is a debatable point in it&#039;s own right, but that&#039;s another debate altogether!

What about debugging? Our debugging process with views is simply debugging a piece of SQL...with the OWB approach I guess that&#039;s a bit more complicated?

It&#039;s a tricky one really and one that the architects team at my current client have debated numerous times over the past few years. We&#039;re using the complex views approach currently but we&#039;re open to moving if and when we see compelling reasons to do so.

Cheers
Jeff</description>
		<content:encoded><![CDATA[<p>Hi Peter</p>
<p>Completely agree that there is no &#8220;always true&#8221; answer&#8230;I guess the article someone needs to write is one that debates the reasoning behind either choice&#8230;I&#8217;ve thought about doing that myself, but I haven&#8217;t got the time at the minute.</p>
<p>Yes, that&#8217;s why we&#8217;re considering the &#8220;inside OWB&#8221; route going forwards&#8230;the documentation reasoning&#8230;.but I&#8217;m not necessarily sure that the documentation is meaningful per se.</p>
<p>Yes, I&#8217;d have a &#8220;pretty picture&#8221; but unless I train the end users, they wouldn&#8217;t be able to understand it any more than they can looking inside the view &#8211; for the more complex mappings &#8211; easy ones perhaps. The developers would be able to use it, but I can&#8217;t see anyone developing on a warehouse without being a proficient SQL developer&#8230;and, in my experience at least, they&#8217;d much rather write a view than paint pretty pictures.</p>
<p>I know from experience on the current implementation I&#8217;m working on, that the code falls into 30% simple views and 70% complicated views buckets and consequently, for the majority of mappings, only the &#8220;exceptional developers&#8221; will be able to make use of that documentation &#8211; not that that&#8217;s a bad thing of course.</p>
<p>The more complex it is, the more likely I&#8217;d want to write it in SQL, rather than build it inside OWB&#8230;adding that to the fact that it&#8217;s easier to develop using one approach rather than two, that then leads me to writing everything in views rather than OWB. Your mileage, as they say, may vary.</p>
<p>If you then start talking automatically generating code, is it easier to generate the complex SQL for views and simple OMB mappings using OMBPlus, or use OMBPlus to generate all of it? I&#8217;d suggest the former since use of the less widely known OMBPlus, is minimal then.</p>
<p>What about tuning? You build a complex mapping and deploy it&#8230;it doesn&#8217;t run right due to a bad plan, so you need to tune it&#8230;there are, of course, a number of ways to tackle that&#8230;but if your method of choice is adding hints, then that, from my understanding, gets a bit tricky if it&#8217;s all inside OWB&#8230;but very simple if it&#8217;s a view. Of course using hints is a debatable point in it&#8217;s own right, but that&#8217;s another debate altogether!</p>
<p>What about debugging? Our debugging process with views is simply debugging a piece of SQL&#8230;with the OWB approach I guess that&#8217;s a bit more complicated?</p>
<p>It&#8217;s a tricky one really and one that the architects team at my current client have debated numerous times over the past few years. We&#8217;re using the complex views approach currently but we&#8217;re open to moving if and when we see compelling reasons to do so.</p>
<p>Cheers<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Scott</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9215</link>
		<dc:creator>Peter Scott</dc:creator>
		<pubDate>Thu, 23 Apr 2009 06:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9215</guid>
		<description>Jeff raises a good question about whether to use a view or code in the ETL tool - we (one of the Rittman Mead team) should write on this; of course there is not going to be an &quot;always true&quot; answer.

The data warehouse project I am working on at the moment gives me a choice of an analytic view to get previous states of an item or &quot;writing&quot; some complex map in OWB - the measures for this fact are based on the nature of the transition and not the state itself. In terms of simplicity (and probably performance) the view is highly attractive; but of course it obscures the transformation.</description>
		<content:encoded><![CDATA[<p>Jeff raises a good question about whether to use a view or code in the ETL tool &#8211; we (one of the Rittman Mead team) should write on this; of course there is not going to be an &#8220;always true&#8221; answer.</p>
<p>The data warehouse project I am working on at the moment gives me a choice of an analytic view to get previous states of an item or &#8220;writing&#8221; some complex map in OWB &#8211; the measures for this fact are based on the nature of the transition and not the state itself. In terms of simplicity (and probably performance) the view is highly attractive; but of course it obscures the transformation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9209</link>
		<dc:creator>Jeff Moss</dc:creator>
		<pubDate>Wed, 22 Apr 2009 20:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9209</guid>
		<description>Well, I&#039;m glad you think I and the team I work with are &quot;exceptional developers&quot;! 

;-)

The documentation reason is perhaps the only reason our team is considering the &quot;do it inside OWB&quot; approach now...but of course we have all these exceptional developers who are used to writing views to do the &quot;work&quot; and not particularly used to writing OWB mappings using the &quot;inside the tool&quot; techniques and a whole codebase that uses the views approach, so it would be a bit radical if we were to change our strategy now...the old adage, if it ain&#039;t broke, don&#039;t fix it, springs to mind.

Cheers
Jeff</description>
		<content:encoded><![CDATA[<p>Well, I&#8217;m glad you think I and the team I work with are &#8220;exceptional developers&#8221;! </p>
<p>;-)</p>
<p>The documentation reason is perhaps the only reason our team is considering the &#8220;do it inside OWB&#8221; approach now&#8230;but of course we have all these exceptional developers who are used to writing views to do the &#8220;work&#8221; and not particularly used to writing OWB mappings using the &#8220;inside the tool&#8221; techniques and a whole codebase that uses the views approach, so it would be a bit radical if we were to change our strategy now&#8230;the old adage, if it ain&#8217;t broke, don&#8217;t fix it, springs to mind.</p>
<p>Cheers<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stewart Bryson</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9205</link>
		<dc:creator>Stewart Bryson</dc:creator>
		<pubDate>Wed, 22 Apr 2009 13:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9205</guid>
		<description>@Scott
That&#039;s a great solution. It&#039;s good to see developers step away from the cookie-cutter date dimension and actually USE it for their purposes. The original ETL I wrote didn&#039;t count days... that was used for simplicity in this example. I was actually calculating multiple business metrics using seconds, doing some complicated expressions on the BEGIN and END status days. I&#039;m not certain if I would have been able to do that with additions to the date dimension or not.

@Jeff
It depends on your requirements. With some shops, the key is getting to market quickly, and with exceptional developers doing all the complex logic, that model has tremendous upside. Other organizations will use OWB to allow a mix of talents and skill levels in a development team to all contribute to the same code in a modular fashion. In those scenarios, having the &quot;pretty pictures&quot; as you say serves to better document the source-to-target mappings inherent in the process. That&#039;s one of the real benefits of OWB... it can adjust to your skill level to provide different ways of accomplishing the same task.

Personally, I choose to put the logic in OWB whenever possible. However, when I take that position, and then find myself having to do logic in a view, I am possibly watering down the rest of the OWB logic because I have essentially placed the logic in two places. Your approach always maintains the logic in one place, so it certainly gets points in that regard.</description>
		<content:encoded><![CDATA[<p>@Scott<br />
That&#8217;s a great solution. It&#8217;s good to see developers step away from the cookie-cutter date dimension and actually USE it for their purposes. The original ETL I wrote didn&#8217;t count days&#8230; that was used for simplicity in this example. I was actually calculating multiple business metrics using seconds, doing some complicated expressions on the BEGIN and END status days. I&#8217;m not certain if I would have been able to do that with additions to the date dimension or not.</p>
<p>@Jeff<br />
It depends on your requirements. With some shops, the key is getting to market quickly, and with exceptional developers doing all the complex logic, that model has tremendous upside. Other organizations will use OWB to allow a mix of talents and skill levels in a development team to all contribute to the same code in a modular fashion. In those scenarios, having the &#8220;pretty pictures&#8221; as you say serves to better document the source-to-target mappings inherent in the process. That&#8217;s one of the real benefits of OWB&#8230; it can adjust to your skill level to provide different ways of accomplishing the same task.</p>
<p>Personally, I choose to put the logic in OWB whenever possible. However, when I take that position, and then find myself having to do logic in a view, I am possibly watering down the rest of the OWB logic because I have essentially placed the logic in two places. Your approach always maintains the logic in one place, so it certainly gets points in that regard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9203</link>
		<dc:creator>Jeff Moss</dc:creator>
		<pubDate>Wed, 22 Apr 2009 08:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9203</guid>
		<description>Welcome Stewart.

It&#039;s interesting that you raise the point of OWB not being able to do something and then coding around it inside a view...I spend a lot of time on a Data Warehouse system that is largely based on that way of doing things, i.e. views with all the &quot;work&quot; in them and simple OWB mappings that take those views and push the generated transactions to targets. 

The design approach to use code inside views, was taken for that system, at a time when OWB was on version 9 (way old now) and when it was quite immature in terms of functionality - perhaps the right choice then as we kept hitting similar issues to the one you describe, where we couldn&#039;t do what we wanted with OWB. 

Whether it&#039;s the right choice now? Well, I think there are still some advantages to choosing the views to do all the &quot;complex&quot; coding rather than drawing pretty pictures in OWB...but this client is actively looking at whether they should be using more of the OWB product going forwards.

Might be nice to see a comparison piece about why one should choose one approach over the other...

Cheers
Jeff</description>
		<content:encoded><![CDATA[<p>Welcome Stewart.</p>
<p>It&#8217;s interesting that you raise the point of OWB not being able to do something and then coding around it inside a view&#8230;I spend a lot of time on a Data Warehouse system that is largely based on that way of doing things, i.e. views with all the &#8220;work&#8221; in them and simple OWB mappings that take those views and push the generated transactions to targets. </p>
<p>The design approach to use code inside views, was taken for that system, at a time when OWB was on version 9 (way old now) and when it was quite immature in terms of functionality &#8211; perhaps the right choice then as we kept hitting similar issues to the one you describe, where we couldn&#8217;t do what we wanted with OWB. </p>
<p>Whether it&#8217;s the right choice now? Well, I think there are still some advantages to choosing the views to do all the &#8220;complex&#8221; coding rather than drawing pretty pictures in OWB&#8230;but this client is actively looking at whether they should be using more of the OWB product going forwards.</p>
<p>Might be nice to see a comparison piece about why one should choose one approach over the other&#8230;</p>
<p>Cheers<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Powell</title>
		<link>http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/comment-page-1/#comment-9202</link>
		<dc:creator>Scott Powell</dc:creator>
		<pubDate>Wed, 22 Apr 2009 06:16:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2009/04/22/using-a-partition-by-join-to-fill-in-the-gaps/#comment-9202</guid>
		<description>Hi Stewart - apologies in advance that I haven&#039;t had time to digest the &quot;partition by join&quot; piece (it&#039;s late...) - but I did want to add a comment about using calendars to count &quot;business days&quot; in general. When I build a time dimension (and assuming it has weekend and holiday indicators), I also build a column called business_day_num - which is simply a sequential count of all business days from whatever the first day in the time dim is. i.e. if the calendar starts 1/1/1970, then 1/2/1970 would be business_day_num = 1, 1/3/1970 would be business_day_num = 2 (assuming they are weekdays, of course), up to whatever end date you go through (i.e. assuming 250 business days per year, you&#039;d have something like business_day_num = 7500 after 30 years...).

For every day that is NOT a business day, it simply gets the business_day_num of the previous day.

Then, calculating the # of business days between two given dates becomes a simple subtraction.

Hope this helps,
Scott</description>
		<content:encoded><![CDATA[<p>Hi Stewart &#8211; apologies in advance that I haven&#8217;t had time to digest the &#8220;partition by join&#8221; piece (it&#8217;s late&#8230;) &#8211; but I did want to add a comment about using calendars to count &#8220;business days&#8221; in general. When I build a time dimension (and assuming it has weekend and holiday indicators), I also build a column called business_day_num &#8211; which is simply a sequential count of all business days from whatever the first day in the time dim is. i.e. if the calendar starts 1/1/1970, then 1/2/1970 would be business_day_num = 1, 1/3/1970 would be business_day_num = 2 (assuming they are weekdays, of course), up to whatever end date you go through (i.e. assuming 250 business days per year, you&#8217;d have something like business_day_num = 7500 after 30 years&#8230;).</p>
<p>For every day that is NOT a business day, it simply gets the business_day_num of the previous day.</p>
<p>Then, calculating the # of business days between two given dates becomes a simple subtraction.</p>
<p>Hope this helps,<br />
Scott</p>
]]></content:encoded>
	</item>
</channel>
</rss>
