<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Dave's Adventures in Business Intelligence &#187; Full Client</title>
	<atom:link href="http://www.dagira.com/category/report-techniques/full-client-tips-and-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagira.com</link>
	<description>...you are in a twisty maze of passageways, all different...</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:13:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>blogmaster@dagira.com ()</managingEditor>
		<webMaster>blogmaster@dagira.com()</webMaster>
		<category></category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>...you are in a twisty maze of passageways, all different...</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>blogmaster@dagira.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.dagira.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.dagira.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>Dave's Adventures in Business Intelligence</title>
			<link>http://www.dagira.com</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Making Up Data Part II: Using Universe Data</title>
		<link>http://www.dagira.com/2009/12/05/making-up-data-part-ii-using-universe-data/</link>
		<comments>http://www.dagira.com/2009/12/05/making-up-data-part-ii-using-universe-data/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:00:51 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Multiple Data Providers]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=225</guid>
		<description><![CDATA[In Part I of this series I talked briefly about the need for report writers to sometimes &#8220;make up&#8221; data. In that post I showed how I could use the Web Intelligence Rich Client (or alternatively Desktop Intelligence) to import data from a spreadsheet in order to fill out holes in data. In this post [...]]]></description>
			<content:encoded><![CDATA[<p>In Part I of this series I talked briefly about the <a href="http://www.dagira.com/2009/11/09/making-up-data-part-i-personal-data-providers/">need for report writers to sometimes &#8220;make up&#8221; data</a>. In that post I showed how I could use the Web Intelligence Rich Client (or alternatively Desktop Intelligence) to import data from a spreadsheet in order to fill out holes in data. In this post I am going to show an equivalent solution using multiple data providers from a universe instead. I will redo the same example shown before (with a lot fewer screenshots since quite a bit of the process is the same). Because I am using a universe I can show two different possible solutions. <span id="more-225"></span></p>
<h3>Filling Out A Calendar</h3>
<p>My report requirement states that all months &#8211; whether they have sales data or not &#8211; must appear in my output. Because Web Intelligence cannot make up data to fill out the missing months, I need to have an alternative source. In the first post in this series I showed how to do that with a personal data provider as I built out the data in a spreadsheet. This time I am going to show how to do the same thing using only a universe. In order to provide a complete (clean) solution I am going to have to make a new object in my universe.</p>
<p>The first step is to create a query that returns some data. I am going to use the same data that I started with on the last post, which is six months of sales revenue data from the eFashion database. I am also limiting the data to the year 2001 in order to match the example from the last post.</p>
<p><img src="/tips/universe_data_merge/raw_data.jpg" /></p>
<p>Next I will create a second data provider from the calendar table that includes all of my month values. Since this query has no restrictions (conditions) and no measures (no joins to any fact table) it will be guaranteed to return every month. At this point in the last post I detailed how to merge (link) two data providers together. This time that step is not required. That&#8217;s the first advantage of using universe data to perform this step: the dimension objects that are shared across my two queries are already merged (linked). When I used personal data, I had to do the merge step myself.</p>
<p>Once I drag the merged month into my report block I will see all 12 month names. As I did last time I will also replace the existing Month Name detail object with the one that comes from my calendar data provider. The results from these operations are shown in the screenshot below. The &#8220;Discontinued&#8221; value comes from a custom format used in the eFashion universe. The universe was designed with the assumption that if any cell was empty (as opposed to zero) then there were no sales for that item, and it must have been discontinued.</p>
<p><img src="/tips/universe_data_merge/merged_data.jpg" /></p>
<p>I would like to insert a zero value into those &#8220;Discontinued&#8221; cells. I could make it look like it has a zero by changing the format. But if I want an average of that column to be impacted by the fact that I had zero sales for six months out of the year, I need to have an actual zero in the cell, not just a custom format. It&#8217;s at this point that I have gone as far as I can without talking to my universe designer.</p>
<h3>Creating and Using Placeholder Objects</h3>
<p>As a universe designer I can help solve this problem. I might create a special class called &#8220;Placeholder Objects&#8221; that includes new objects used to solve this type of problem. <em>(I have also seen these objects called &#8220;dummy&#8221; objects because they are only going to work in very specific situations. They&#8217;re not &#8220;smart enough&#8221; to be used by themselves.)</em> When I used personal data to solve this issue I created a new column in my spreadsheet and put a zero in for every month. In my universe I will create just one object with a zero value in the select clause and nothing in the tables. <em>Note that this object will not parse; that is expected.</em></p>
<p><img src="/tips/universe_data_merge/zero.jpg" /></p>
<p>Since this object does not have a table associated with it I will need to make sure that it&#8217;s used with at least one &#8220;real&#8221; object in a query. As a universe designer I can&#8217;t enforce this. But if a report writer tried to use this object by itself the query would not run. I have seen some folks suggest that objects like this should be pointed to the DUAL table (in Oracle) or something similar. I disagree. The only benefit to doing this is that the object will parse. But at the same time I am fixing that issue I would be introducing an entirely new set of issues because the DUAL table isn&#8217;t typically going to join to any other table. It&#8217;s much more effective to leave this object in a state where it won&#8217;t parse than to deal with all of that mess.</p>
<h3>Rebuilding the Query</h3>
<p>Once I have created my dummy object and exported the updated universe I can fix the problem. In fact I can fix it a couple of different ways. First, I could mimic the solution from the last post by adding the zero object to my calendar-only data provider. Since I have already covered all of those steps I thought I would show a different technique for this post. I am going to use a UNION query.</p>
<p>A union requires that all of the queries (you can have two or more) match. Each query has to include the exact same number of objects, and the object types (character, date, number) have to match as well. For the scenario I am using for this post each query will have three objects. Both queries will include the Month and Month Name. The first query will also include the new Zero object. The second query will include the regular revenue object. Here are the two screen shots showing what this query looks like.</p>
<p><strong>Query Panel Union Part 1</strong><br />
<img src="/tips/universe_data_merge/query_01.jpg" /></p>
<p><strong>Query Panel Union Part 2</strong><br />
<img src="/tips/universe_data_merge/query_02.jpg" /></p>
<p>Notice that the first query does not have any conditions at all? The second query includes the condition that I created to drop out months (it only shows months with an &#8220;e&#8221; in their name) as well as a limit to show data only for 2001 as mentioned earlier. When I run the combined queries I see this output.</p>
<p><img src="/tips/universe_data_merge/union_data.jpg" /></p>
<p>At this point the data looks great, and it was obtained with a minimal amount of fuss. All of the months show up as required. There are no merged dimensions here since everything is returned in a single data provider. However, there is one item that needs to be fixed. Check out the column headers&#8230; they&#8217;re not exactly &#8220;user friendly&#8221; at this point. What happened? It turns out that column headers from a union query are taken from the first pass of the data provider. As a result my column header says &#8220;Zero&#8221; instead of &#8220;Sales revenue&#8221; as I would expect. Fortunately Web Intelligence (the Rich Client in this case) makes this process extremely simple. All I have to do is open the query panel and drag &#8220;Query 2&#8243; in front of &#8220;Query 1&#8243; in the union area of the query panel and rerun. After rerunning the query I am left with a report block that is missing a measure. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_eek.gif' alt=':shock:' class='wp-smiley' />  This is okay, because the object named &#8220;Zero&#8221; has been removed from the query, and a new object &#8220;Sales revenue&#8221; has appeared. All I have to do is drag that new measure onto the block and I see these results.</p>
<p><img src="/tips/universe_data_merge/final_data.jpg" /></p>
<p>Notice that I have added an Average calculation in the footer to show that the zero values are being included during the calculation. The result obtained via this process is now essentially identical to that shown in the first post about making up data. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<h3>Conclusion</h3>
<p>So far I have shown two different techniques that can be used to &#8220;make up&#8221; data for a report: personal data and universe data. Which is better? As with many questions the answer is &#8220;It depends.&#8221; <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' />  Personal data has an advantage in that it can be built on the fly by a report user and does not require any universe maintenance. Universe data has an advantage in that the extra objects are reusable and are available to anyone. With proper training users can build queries that can include extra data that does not exist in the database. </p>
<p>Personal data requires me to know how to merge the results. With universe data the merge step (as long as I use the same objects) is performed automatically.</p>
<p>In this post I also showed two different techniques for getting the &#8220;filler data&#8221; into my report. With personal data I have to create two data providers and merge the results. With universe objects I have the option of creating a single data provider using a Union technique and my placeholder object.</p>
<p>The placeholder measure object that I created is not limited to this particular report. I can use (and reuse) it for any other report with similar requirements. Since the object is not tied to the calendar (or any other dimension) I can use it anywhere. It can be used to merge data providers or in a union query. I can create similar &#8220;dummy&#8221; objects for dates or text fields as needed. Ultimately I can decide if I want these special objects to be visible to all users or to a selected subset of &#8220;power user&#8221; report writers using the standard security process.</p>
<h3>Next Time</h3>
<p>For Part III of this post I am going to create a more complex example where data might be missing from more than one dimension (instead of just month as I have used in the last two posts.) I am also going to show cross tab and a section output because each of those can cause some interesting challenges as well. Maybe I&#8217;ll even do a sectioned cross tab. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Related Posts</strong></p>
<ul>
<li><a href="http://www.dagira.com/2009/11/09/making-up-data-part-i-personal-data-providers/">Making Up Data Part I: Personal Data Providers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/12/05/making-up-data-part-ii-using-universe-data/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Making Up Data Part I: Personal Data Providers</title>
		<link>http://www.dagira.com/2009/11/09/making-up-data-part-i-personal-data-providers/</link>
		<comments>http://www.dagira.com/2009/11/09/making-up-data-part-i-personal-data-providers/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 07:18:06 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=219</guid>
		<description><![CDATA[Reporting tools are designed to report. Seems simple, doesn&#8217;t it? But sometimes they need to do more in order to meet the requirements. For example, a frequent question on BOB (in fact it&#8217;s in the Reporter FAQ) goes like this:
I have only six months of data, but I have to show all twelve months in [...]]]></description>
			<content:encoded><![CDATA[<p>Reporting tools are designed to report. Seems simple, doesn&#8217;t it? But sometimes they need to do more in order to meet the requirements. For example, a frequent question on <a href="http://busobj.forumtopics.com">BOB</a> (in fact it&#8217;s in the Reporter FAQ) goes like this:</p>
<blockquote><p>I have only six months of data, but I have to show all twelve months in my report. How can I show the missing data?</p></blockquote>
<p>The trick is to understand that Business Objects does not make up data. It just doesn&#8217;t have that capability. And you can&#8217;t edit the report directly in order to add those extra values to the result set. However, there are a couple of tricks that I can share that will help solve this issue. <span id="more-219"></span></p>
<p><strong>Special Note to Blog Readers:</strong> This post is fairly long because it has quite a few screen shots to illustrate the process. As a result it will be presented in several pages. When you get to the bottom of a page just click on the next page number from the links provided to continue reading the post. Since this is the first time I have used this feature I thought I would warn you about that. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Now on with the solution.</p>
<h3>Using Personal Data</h3>
<p>One of the easiest ways to make up data for a report is to use a personal data provider. This technique can be used in all versions of Desktop Intelligence and also in the newer &#8220;rich client&#8221; version of Web Intelligence. While the specific steps are unique to each tool the general concept is the same, so I will only show how to do this using the rich client. <em>Screen shots for this blog post were taken from version 3.0 of the Web Intelligence Rich Client.</em></p>
<p>The first step is to determine what is missing and therefore what you need to make up as filler information. It&#8217;s also important to know that the format of your personal data has to match what is coming from your enterprise data source or the data won&#8217;t merge properly. For this scenario I will show some data coming from the eFashion database. I am going to restrict the data to months that include an &#8220;e&#8221; in their name, just to make sure that I have holes in my data. If you&#8217;re wondering, that includes February, June, September, October, November, and December. Why did I pick that? No reason, really, just thought it would be fun. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After applying that condition (along with another to restrict to one specific year) I see the following data on my report.</p>
<p><img src="/tips/personal_data_merge/raw_data.jpg" /></p>
<p>In the eFashion universe the <strong>Month</strong> is a dimension object and is a numeric value. The <strong>Month Name</strong> is a character string containing the month name spelled out (October rather than just Oct) and is configured as a detail object. This is important. When I want to merge two different data providers together I have to perform that process (the merge or link step) using only dimension objects. I cannot use detail objects. That means my personal data provider will have to include the month number as a dimension, and it should also include the month name as a detail.</p>
<p>After building up this query I have six months of data, as described in my original scenario. To meet the report requirements I have to show all twelve months, including those that don&#8217;t have sales that meet my current criteria. How can I make this happen?</p>
<h3>Making Up Data</h3>
<p>I am going to use a spreadsheet to make up my data, but I could just as easily use a delimited text or CSV file created with any text editor. The trick is that I have to structure my personal data so that it matches what I already have from the universe. To solve the scenario I am currently working on that means that I need the month number <strong>and</strong> the month name in my personal data. Here&#8217;s how that looked when I was done.</p>
<p><img src="/tips/personal_data_merge/raw_data_xls.jpg" /></p>
<p>I saved this data on my computer as a standard spreadsheet file. I could also have used a comma separated values (CSV) or other structured text file just as easily. The next step is to import this data into my document.</p>
<h3>Adding Personal Data</h3>
<p>In order to add personal data to my document I open the query panel, right click on the current query tab, and select the option to add a new data provider. After I do that I see this dialog box.</p>
<p><img src="/tips/personal_data_merge/add_new_data.jpg" /></p>
<p>After making sure I select &#8220;Local data source&#8221; I move on to the next step, which is to browse my computer and find the spreadsheet file I saved earlier. Once I find the file I am presented with a few configuration options as shown here.</p>
<p><img src="/tips/personal_data_merge/new_personal_config.jpg" /></p>
<p>The filename is there, of course. Since I am using a spreadsheet I can pick which sheet from the workbook contains my data. I can also determine whether to use a named range, to enter the range myself, or to let the client try to figure out where all of the data is for me. For this simple case I mark &#8220;All fields&#8221; and let the client do just that. Finally, I confirm that the box for &#8220;First row contains column names&#8221; is checked and click the Next button. Here is what I see at this point in the process.</p>
<p><img src="/tips/personal_data_merge/new_data_objects.jpg" /></p>
<p>There are a couple of problems with this result. The client is trying to be helpful, but it&#8217;s making the wrong decisions for me. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The Month column contained all numeric values so it was imported as a measure. The Month Name contained character data so it was imported as a dimension. Both of these assumptions are wrong. I need the month number to be a dimension so I can link it to the value I already have, and I need the name to be a detail in order to match the existing structure on the report. Fortunately, since this is my own personal data, I am allowed to make changes to the configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/11/09/making-up-data-part-i-personal-data-providers/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Using ForceMerge() To Fix Unbalanced Data Providers</title>
		<link>http://www.dagira.com/2009/09/03/using-forcemerge-to-fix-unbalanced-data-providers/</link>
		<comments>http://www.dagira.com/2009/09/03/using-forcemerge-to-fix-unbalanced-data-providers/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 12:30:35 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=62</guid>
		<description><![CDATA[I have discussed the MultiCube() function a number of times in my series of Variables presentations. In certain situations it allows you to fix measure objects when you have two (or more) unbalanced data providers in a full-client document. ForceMerge() is the equivalent for Web Intelligence.
So how do they work, exactly? What do I mean [...]]]></description>
			<content:encoded><![CDATA[<p>I have discussed the <code>MultiCube()</code> function a number of times in my series of Variables presentations. In certain situations it allows you to fix measure objects when you have two (or more) unbalanced data providers in a full-client document. <code>ForceMerge()</code> is the equivalent for Web Intelligence.</p>
<p>So how do they work, exactly? What do I mean by unbalanced data providers? How is it fixed with these functions? Are there any special conditions to be aware of?<span id="more-62"></span></p>
<h3>Merged Data Provider Review</h3>
<p>I recently published a blog post that described unbalanced data providers. If you want the full description, I have included a link at the end of this post. If you want the executive summary, here it is:</p>
<blockquote><p>When you have two (or more) data providers in the same document and want to merge the data, you have to link them using dimension objects. If you don&#8217;t have the same number of dimensions from each data provider, then they are unbalanced. That can cause issues.</p></blockquote>
<p>It took me twelve hundred words (and six pictures) to provide a detailed explanation in my earlier post. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' />  In the sample report I used for that post I had one common dimension (Year) and one unique dimension from each side (Resort and Region). I showed how I could use Year with either measure since it was a shared (and linked) dimension.</p>
<p><img src="/tips/forcemerge/merged_block.jpg" width="325" height="121" border="0" alt="merged block image" title="Web Intelligence report with Merged Data" /></p>
<p>I also showed how (and explained why) trying to use the &#8220;extra&#8221; dimensions like Region or Resort caused problems. I don&#8217;t intend to repeat everything here; please use the link at the end of this post to read the prior post if you are unclear on anything so far.</p>
<h3>What About MultiCube()?</h3>
<p>One of the comments I got on that post suggested that <code>MultiCube()</code> could be used to fix the issue. My response was accurate as far as I was concerned, but later when I read it again I realized it could also be quite confusing. Here&#8217;s what I said:</p>
<blockquote><p>&#8230;the MultiCube() function will help if data providers are unbalanced “upwards” but not “downwards” &#8230;</p></blockquote>
<p>After reviewing my response, I realized that it was quite likely that I was the only person that understood what I meant by that statement. While at times I do enjoy talking with myself <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  that&#8217;s not why I have this blog. So I am going to try to explain that a bit further.</p>
<p>The problem with trying to use <code>MultiCube()</code> or the Web Intelligence equivalent <code>ForceMerge()</code> to solve this specific case is that the data doesn&#8217;t support the solution. There is no hierarchy or relationship between Region and Resort. <em>(Yes, they are both related via links to the fact table but that&#8217;s not what I mean.)</em> Resort is a place. Region is an attribute of the customer. There is a many to many relationship between regions and resorts, and that sort of relationship is essentially worthless. If I can&#8217;t determine how to put things together, how are the numbers going to make sense? Neither of these functions can create a relationship from nothing.</p>
<p>Yet there are some cases where I can fix unbalanced data providers. I need to talk about the data first, then I need to create a new document with the proper structure in order to show how the <code>ForceMerge()</code> function works.</p>
<h3>Hierarchical Data</h3>
<p>Here is what I consider to be a really good example of why this is a problem. Most people think of time as a really clean hierarchy. On the surface the hierarchy is simple: Months go into quarters, and quarters go into years. Yet if I create a query with the Quarter and Revenue from the Island Resorts database here is what I get.</p>
<p><img src="/tips/forcemerge/quarter_sales.jpg" width="217" height="121" border="0" alt="Quarter sales image" title="Web Intelligence Report showing Quarter Revenues" /></p>
<p>Take a look at the data and tell me how you would break out the quarter data into different years. </p>
<p>Go ahead and think a bit, I can wait.</p>
<p>One-Mississippi.</p>
<p>Two-Mississippi.</p>
<p>You can&#8217;t do it, can you? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You don&#8217;t have enough information. As defined, with the format &#8220;Q1&#8243; and &#8220;Q2&#8243; and so on, there is no indication as to which year the quarter revenues are coming from. You can&#8217;t &#8220;break down&#8221; the quarter by year with the information that you have. That is what I meant by data being unbalanced &#8220;downwards&#8221; in my comment on my prior post. I can&#8217;t break data down because the information simply isn&#8217;t there.</p>
<p>What I can do, however, is roll up or move &#8220;upwards&#8221; via a hierarchy. That&#8217;s where the <code>ForceMerge()</code> function comes into play.</p>
<h3>Introducing the ForceMerge() Function</h3>
<p>Here is what the help text says for the <code>ForceMerge()</code> function.</p>
<blockquote><p>Forces Web Intelligence to account for synchronized dimensions in measure calculations when the synchronized dimensions do not appear in the calculation context of the measure</p></blockquote>
<p>I will explain what this means, but first I am going to build my example. My document will have two data providers from the Island Resorts Marketing universe. My first data provider has dimension values Country and Resort and the Revenue measure. My second data provider has the dimension Resort and the measure Guests. I will link the two data providers by Resort as it is the only common dimension.</p>
<p>Data Provider 1<br />
<img src="/tips/forcemerge/dp01_objects.jpg" width="252" height="74" border="0" alt="First Data Provider Image" title="Web Intelligence Data Provider Defintion #1" /></p>
<p>Data Provider 2<br />
<img src="/tips/forcemerge/dp02_objects.jpg" width="205" height="67" border="0" alt="Second Data Provider Image" title="Web Intelligence Data Provider Defintion #2" /></p>
<p>Data Provider Results<br />
<img src="/tips/forcemerge/dp_results.jpg" width="565" height="97" border="0" alt="" title="Web Intelligence Query Results" /></p>
<p>Merged Dimensions<br />
<img src="/tips/forcemerge/merged_dimensions.jpg" width="183" height="168" border="0" alt="" title="Web Intelligence Document Structure" /></p>
<p>From this point I will create a merged block using all of the measures and both dimensions. Here are the results from that experiment.</p>
<p><img src="/tips/forcemerge/merged_working.jpg" width="433" height="97" border="0" alt="" title="Web Intelligence Document with working merged data" /></p>
<p>Everything is fine so far. The issue becomes evident when I remove the Resort object from the block. Remember that my two data providers are merged (synchronized) by Resort. When that object is no longer present in the block, the measures roll up. Revenue is still okay because the Country object was part of the query context of that data provider. The Guests measure fails because it is now being viewed out of context. <em>(At the risk of becoming tedious, I will point out one last time that this issue is covered in much more detail in the first post in this series.)</em></p>
<p><img src="/tips/forcemerge/merge_fail.jpg" width="325" height="73" border="0" alt="" title="Web Intelligence Document with invalid merged data due to unbalanced dimensions" /></p>
<p>I have created a problem. Next, I will explain how to fix it.</p>
<h3>ForceMerge() In Action</h3>
<p>All of the information I need is there in the document. It just does not show up in the block. Here once again is the help text for the <code>ForceMerge()</code> function:</p>
<blockquote><p>Forces Web Intelligence to account for synchronized dimensions in measure calculations when the synchronized dimensions do not appear in the calculation context of the measure</p></blockquote>
<p>Simply put, the function tells Web Intelligence to <strong>use all of the information from the cube, rather than being limited to what is shown in the block</strong>. I will create a new variable with this formula:</p>
<p><code>=ForceMerge([Number of guests])</code></p>
<p>I will replace my &#8220;broken&#8221; measure with my new variable and observe the results.</p>
<p><img src="/tips/forcemerge/merge_success.jpg" width="325" height="73" border="0" alt="" title="Web Intelligence Document success with ForceMerge function to fix unbalanced dimensions" /></p>
<p>I haven&#8217;t changed my dimension linking. I haven&#8217;t changed my data providers. I didn&#8217;t even change the block structure, other than to replace the broken measure with my corrected calculation. If you were looking for something more complex, I&#8217;m afraid that&#8217;s all there is. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <strong>The complicated part is understanding just what the function does and when to use it, rather than how to use it.</strong> I am glad this function is now available in Web Intelligence starting with XI 3.x. In my opinion, it should have been there since merging data providers was an option.</p>
<h3>Summary</h3>
<p>The magic of the <code>ForceMerge()</code> function (or if using Desktop Intelligence the <code>MultiCube()</code> function) is that it changes the behavior of the report engine. Normally when dimension values are removed from a block they are taken out of context. By using one of these functions I can specify that linked dimensions still have to be considered by the measures even if those dimensions no longer appear in the block structure.</p>
<p>Even with this magic function in my arsenal, I cannot rely on it to fix every problem that I have. If the data can be &#8220;rolled up&#8221; by the calculation process then I am fine. If the data has to be &#8220;broken down&#8221; then I am in trouble, and these functions will not fix the issue. Each resort exists in exactly one country so I can move up the hierarchy from the resort link and the results are valid.</p>
<p><strong>Special Note</strong><br />
If there are smart measures in a universe, then <code>ForceMerge()</code> will not work. In order to calculate the results correctly, smart measures (using the &#8220;database delegated&#8221; projection function) need to have the block structure in place to define the query. According to the documentation, the <code>ForceMerge()</code> function will return a <code>#MULTIVALUE</code> error if used in this situation.</p>
<p><strong>Related Links</strong></p>
<ul>
<li>Blog Post: <a href="http://www.dagira.com/2009/08/25/what-are-unbalanced-data-providers-and-why-should-i-care/">What Are Unbalanced Data Providers&#8230; And Why Should I Care?</a></li>
<li>Blog Post: <a href="http://www.dagira.com/2008/11/10/designer-xi-3-new-feature-database-delegated-measures/">&#8220;Smart&#8221; aka Database Delegated Measures</a></li>
</ul>
<p><strong>What was that &#8220;Mississippi&#8221; thing earlier?</strong><br />
From <a href="http://en.wikipedia.org/wiki/Mississippi#Trivia_and_modern_culture_related">Wikipedia</a>:</p>
<blockquote><p>Children in the United States and Canada often count &#8216;One-Mississippi, two-Mississippi&#8217; during informal games such as hide and seek to approximate counting by seconds.</p></blockquote>
<p>So now you know. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/09/03/using-forcemerge-to-fix-unbalanced-data-providers/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>What Are Unbalanced Data Providers And Why Should I Care?</title>
		<link>http://www.dagira.com/2009/08/25/what-are-unbalanced-data-providers-and-why-should-i-care/</link>
		<comments>http://www.dagira.com/2009/08/25/what-are-unbalanced-data-providers-and-why-should-i-care/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 14:31:59 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=168</guid>
		<description><![CDATA[One of the more powerful features of Web Intelligence (Desktop Intelligence as well) is the ability to combine data from more than one source into one document. This is done by creating multiple data providers, linking them up, and using the combined results in a report block. However, everything has to work out just right. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more powerful features of Web Intelligence (Desktop Intelligence as well) is the ability to combine data from more than one source into one document. This is done by creating multiple data providers, linking them up, and using the combined results in a report block. However, everything has to work out just right. Sometimes it doesn&#8217;t. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Merging Data Providers in Web Intelligence</h3>
<p>Dimensions are the &#8220;keys&#8221; of a data provider. When two database tables are linked in a universe, certain columns are used to join them together. Dimensions serve this role in linking two data providers. When two (or more) data providers are built in Web Intelligence from the same universe they are automatically linked together using any common dimension objects. What happens when two different data sources are used? In that case, the report writer has to merge the information manually. And if the dimensions from each data provider are not identical, the report has what I call &#8220;unbalanced&#8221; data providers. That&#8217;s what I want to describe in this blog post. <span id="more-168"></span></p>
<p>For my sample I will join two data providers from the Island Resorts Marketing universe. I am going to structure my queries in such a way that they will result in an unbalanced scenario. For my first query I will return Resort + Year + Revenue. For the second query I will return Region + Year + Number of Guests. Resort, Year, and Region are all dimension objects, of course, and Revenue and Number of Guests are my measures. Here are the raw results from each individual data provider. (I am using Web Intelligence XI 3.0 for this demonstration.)</p>
<p><img src="/tips/unbalanced_data/raw_data.jpg" width="558" height="292" border="0" alt="Raw Data" title="Raw data for unbalanced data provider demonstration" /></p>
<p>I have one common dimension. I also have two dimensions that are unique, one from each data provider. Since both data providers come from the same universe, the common or shared dimension value (Year) has already been linked, as shown here.</p>
<p><img src="/tips/unbalanced_data/merged_years.jpg" width="538" height="448" border="0" alt="Merged Years" title="Merge dimension screen showing years merged, resort and region not" /></p>
<p>Because the Year object was already merged, I can create a report block that contains Year, Revenue, and Number of Guests. I can also do local variable calculations like Revenue per Guest using simple division.</p>
<p><img src="/tips/unbalanced_data/merged_block.jpg" width="433" height="121" border="0" alt="Merged Block" title="Web Intelligence report block with merged data" /></p>
<p>This is what happens when everything works. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  What if something doesn&#8217;t work?</p>
<h3>Mixing Dimensions Generates Unexpected Results</h3>
<p>This block shows what happens when I add Resort to the block shown previously.</p>
<p><img src="/tips/unbalanced_data/unbalanced.jpg" width="490" height="217" border="0" alt="Unbalanced Block" title="Web Intelligence report block with unbalanced dimension data" /></p>
<p>Notice anything interesting about the data? About the Number of Guests column specifically?</p>
<p>When the year repeats, the Number of Guests repeats. The Revenue measure seems fine. Before I explain this, let me exchange the Region object for the Resort object and show what happens.</p>
<p><img src="/tips/unbalanced_data/unbalanced_region.jpg" width="490" height="347" border="0" alt="Unbalanced Block" title="Web Intelligence report block with unbalanced dimension data" /></p>
<p>In this case, the Revenue column is strange and the Number of Guests looks okay. To make matters even more confusing, here&#8217;s what I get if I apply a Sum() to the Revenue column after doing a break on the Year&#8230;</p>
<p><img src="/tips/unbalanced_data/unbalanced_sum.jpg" width="490" height="241" border="0" alt="Unbalanced Block with Sum" title="Web Intelligence report block with unbalanced dimension data and a sub-total" /></p>
<p>The sum on the footer is identical to the values displayed in the block! Any idea what&#8217;s going on? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_eek.gif' alt=':shock:' class='wp-smiley' /> </p>
<h3>Measures Do Not Sum, They Project</h3>
<p>The secret is that Web Intelligence does not sum a column of values like Excel does. A few weeks ago I discussed the <a href="http://www.dagira.com/2009/07/06/sql-aggregate-versus-universe-projection/">difference between SQL Aggregation and Report Projection</a> which helps explain this. Simply put: when a measure is combined with a set of dimension values in a block, the measure will project (roll up) based on the structure of the block. This is also called the <strong>context</strong> of the measure within the block. <em>(Please note: The use of the word &#8220;context&#8221; in this case should not be confused with the concept of a context &mdash; set of joins &mdash; in a universe design.)</em></p>
<p>Because of the way I structured my queries, the Revenue context is determined by combinations of the Resort and Year objects. The context of the Number of Guests was set by Region and Year. The Year value is the only common dimension between the two data providers, which is why the block with only the Year dimension object showed valid data. However, if I include a dimension that is not part of a measure context, a problem occurs. When Region was added to the block the Revenue was wrong. When Resort was added the Number of Guests was wrong. In each case, the measure was out of context for at least one dimension.</p>
<p>To repeat: When I created the block with Year as the only dimension everything was fine. Each measure includes Year as part of its context. When I added Resort, the Revenue measure was still in context (and therefore showed the correct results) but the Number of Guests object was out of context. As a result, it used the only context it could (Year) and rolled up to that value, then repeated that value each time the year appeared on the block.</p>
<p>What about that weird behavior of the Sum() function? It turns out that a Sum() doesn&#8217;t really add up the column values. It does a projection instead. When the block included both Year and Region, the Revenue measure was valid for only the Year therefore it projected to that value. As a result, the measure value is repeated for each different Region in the body of the block as long as the Year is the same. Adding a break on Year created a footer for the block. Since the context for the footer was Year only, that made the Revenue projection (total) for the Year the same on the footer as it was for the body.</p>
<h3>Unbalanced Dimensions</h3>
<p>Now that I have been through all of that, let me finally explain what I mean by &#8220;unbalanced dimensions&#8221; as used in the title of this blog post. In my data providers I have Year as a common dimension and Resort hanging off of one side and Region hanging off of the other. Web Intelligence will prevent me from adding both Resort and Region to the block at the same time, but it will allow me to add one of them. Assuming I do that (add an extra dimension) I will have two dimensions from one data provider and one from the other. Two against one is unbalanced.</p>
<pre>Resort, Year <-> Year
        Year <-> Year, Region</pre>
<p>It doesn&#8217;t matter which side the extra dimension comes from either. </p>
<p>If you have more than one data provider the following rules apply.</p>
<ol>
<li>All common dimension values should be linked</li>
<li>Measure context is defined by the dimensions in their source data provider</li>
<li>A block with linked dimensions and measures works fine</li>
<li>Unlinked dimensions from <strong>one</strong> data provider can be used; others will be designated as incompatible</li>
<li>Measures from the data provider that includes the extra unlinked dimension will be fine</li>
<li>Measures from the other data provider will repeat for each unlinked dimension value because they are at least partially out of context</li>
</ol>
<p>With all of these complications, Web Intelligence does what it can to show the data properly, even to the point of having the footer totals be correct despite the presense of an unlinked dimension. It&#8217;s better to manage your data providers to avoid this challenge, but it&#8217;s nice to know how things work if you can&#8217;t do that. There are other techniques that can help (like creating variables to demote a dimension to a detail object, if that action is appropriate) but this post is long enough already. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/08/25/what-are-unbalanced-data-providers-and-why-should-i-care/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Variable Relative Block Positioning</title>
		<link>http://www.dagira.com/2007/09/16/variable-relative-block-positioning/</link>
		<comments>http://www.dagira.com/2007/09/16/variable-relative-block-positioning/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 04:19:25 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>

		<guid isPermaLink="false">http://www.dagira.com/2007/09/16/variable-relative-block-positioning/</guid>
		<description><![CDATA[The Challenge
Both Desktop Intelligence and Web Intelligence provide options to coordinate the placement of one block based on the size of another. This technique is used when you have more than one block on a page and you want the lower blocks to move up and down (or left and right) on the page based [...]]]></description>
			<content:encoded><![CDATA[<h3>The Challenge</h3>
<p>Both Desktop Intelligence and Web Intelligence provide options to coordinate the placement of one block based on the size of another. This technique is used when you have more than one block on a page and you want the lower blocks to move up and down (or left and right) on the page based on the volume of data shown in the &#8220;relative&#8221; block. This works quite well with two blocks as shown below.</p>
<p><img src="/tips/variable_relative_blocks/01_two_blocks.gif" width="212" height="126" border="0" alt="Sample two-block layout" title="Sample two-block layout" /></p>
<p>The block on the left in this case (the blue box) would be the anchor block. The block on the right (the red block) would float relative to the anchor block. I can accomplish this by right-clicking on the floating block and selecting Format Block. The Appearance tab includes the following settings that I can tweak:</p>
<p><img src="/tips/variable_relative_blocks/02_relative_blocks.gif" width="359" height="121" border="0" alt="Setting the floating attributes" title="Setting the attributes for the floating block" /></p>
<p>This technique works well for a chain of tables either horizontally or vertically. But what if I have the following scenario where I need to float blocks <strong>both</strong> horizontally and vertically?</p>
<p><img src="/tips/variable_relative_blocks/03_three_blocks.gif" width="212" height="267" border="0" alt="Sample three-block layout" title="Sample three-block layout with combined horizontal and vertical float requirements" /></p>
<p><span id="more-29"></span></p>
<p>The screen shots that will be included in this post are taking from Business Objects 6.5. The same concept should work in Web Intelligence as well, although I don&#8217;t at this time intend to post those instructions. If you don&#8217;t know how to simulate the &#8220;hide block&#8221; option in Web Intelligence you can review my prior post on <a href="http://www.dagira.com/2007/07/31/alerters-on-charts-part-ii/">Chart Alerters in Web Intelligence</a> to see how that could work. Now on with the show.</p>
<h3>The Setup</h3>
<p>I created a query with Year, City, Store Name, Lines, and Revenue from the eFashion universe. My requirement calls for a three-block layout with the top-left block being store revenues, the top-right block is annual revenues, and the lower chart block will show lines revenues in a bar chart. Either the store block or the annual sales block could grow vertically. My requirement also calls for a prompt on the state. My challenge will be to figure out how to make the chart shift up or down based on either of the two top blocks. There is no option to make one block relative to two other blocks, so I will have to be creative. I like challenges like this. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Take Care of the Basics First</h3>
<p>The first step I take to solve this challenge is to give each of my blocks a descriptive name. Since the annual sales block is to the right of the store sales block I will let it float horizontally based on the width of the store block. That&#8217;s fairly straightforward. Here is what the data looks like when I refresh the report for Colorado:</p>
<p><img src="/tips/variable_relative_blocks/08_colorado_sales.gif" width="450" height="377" border="0" alt="Colorado Sales Results" title="Colorado Sales results" /></p>
<p>Everything looks fine. But when I select Texas for my second refresh notice the problem that I have:</p>
<p><img src="/tips/variable_relative_blocks/09_texas_sales.gif" width="450" height="369" border="0" alt="Texas Sales Results" title="Texas Sales results" /></p>
<p>I could solve this by making the chart block float relative to the store revenue block. But that won&#8217;t help if there is only one store that has ten years of sales. In that scenario the annual sales block will encroach on the lines chart just like the store sales block has done in this case. I need to make the chart block float relative to <strong>two blocks</strong> rather than just one.</p>
<h3>Variables to the Rescue</h3>
<p>The solution requires me to be able to tell which block has more data. In this simple scenario it will not be too hard. I have two blocks each with one dimension each. If I count how many dimension values there are and compare the two, I will be able to tell which block is going to be bigger. Here is the variable that I created, called Which Chart:</p>
<p><img src="/tips/variable_relative_blocks/10_flag_variable.gif" width="450" height="66" border="0" alt="Flag variable screen shot" title="Creating the flag variable" /></p>
<p>This flag returns two distinct values: Year Chart or Store Chart. The formula is structured in such a way that the flag returns the name of the chart that I want to hide. But wait a minute, I only have one chart, right? How does one chart end up with two names?</p>
<h3>Double Charts</h3>
<p>In my earlier post on Chart Alerters I showed how to create two duplicate charts, one green and one red, and then set up formulas to only show one or the other. I think I can use that trick again here. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  To solve this challenge I will create two charts. In this case the charts are identical other than their names. They even share the exact same location on the page, as shown here.</p>
<p><img src="/tips/variable_relative_blocks/17_overlay_charts.gif" width="450" height="189" border="0" alt="Overlay charts screen shot" title="Two charts that occupy the same space" /></p>
<p>By the way, the Structure Mode option from Business Objects really helps in completing this report.</p>
<p>The final steps are to float each chart relative to <strong>one</strong> of the two upper blocks, and then hide based on the variable that I created earlier. If the annual block has more rows than the store block, then the chart that floats relative to the store block needs to hide since it won&#8217;t move down far enough. If the store block has more rows then the chart related to the annual block needs to hide for the same reason. Here are the screen shots of those settings:</p>
<p><img src="/tips/variable_relative_blocks/15_hide_year_relative.gif" width="450" height="189" border="0" alt="Hide year block screen shot" title="Settings to show how to hide the chart floating relative to annual sales" /><br />
Notice that the float is relative to the Annual Sales block, and the hide formula is active if the chart to hide is the Year Chart.</p>
<p><img src="/tips/variable_relative_blocks/16_hide_store_relative.gif" width="450" height="189" border="0" alt="Hide store block screen shot" title="Settings to show how to hide the chart floating relative to store sales" /><br />
For the second chart the float is relative to the Store Revenue block, and the hide formula is active if the chart to hide is the Store Chart.</p>
<h3>Test the Results</h3>
<p>Once I finish creating my two charts, configure the relative float numbers, and create my hide conditions, how does it all look? The pictures tell the tale&#8230;</p>
<p><img src="/tips/variable_relative_blocks/20_colorado_works.gif" width="450" height="363" border="0" alt="Colorado working screen shot" title="Colorado report with longer annual sales block" /></p>
<p><img src="/tips/variable_relative_blocks/21_texas_works.gif" width="450" height="433" border="0" alt="Texas working screen shot" title="Texas report with longer store sales block" /></p>
<h3>Summary</h3>
<p>The purpose of this article was to show how to simulate the ability to float a block relative to two anchor blocks rather than just one. Since Business Objects does not provide this feature directly I used a variable, two charts, and a &#8220;hide block&#8221; setting instead.</p>
<h3>Associated Downloads</h3>
<ul>
<li><a href='http://www.dagira.com/wp-content/uploads/2007/08/variable-relative-block-positioning.zip' title='variable-relative-block-positioning.zip'>BusinessObjects 6.5 Sample</a><br />
This download was built using the eFashion sample database provided by Business Objects. It should be accessable to anyone using version 6.5 or higher. The source file is zipped so you will need an unzipping utility to extract the file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2007/09/16/variable-relative-block-positioning/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Alerters on Charts: Part I</title>
		<link>http://www.dagira.com/2007/07/22/alerters-on-charts/</link>
		<comments>http://www.dagira.com/2007/07/22/alerters-on-charts/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 17:28:14 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Full Client]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>

		<guid isPermaLink="false">http://www.dagira.com/2007/07/22/alerters-on-charts/</guid>
		<description><![CDATA[The Challenge
Officially there is no way to put an alerter on a chart. Yet some time back I was challenged by a client to create a line chart that was green if the overall trend was up, and red if the overall trend was down. This chart appeared in a sectioned report so there was [...]]]></description>
			<content:encoded><![CDATA[<h3>The Challenge</h3>
<p>Officially there is no way to put an alerter on a chart. Yet some time back I was challenged by a client to create a line chart that was green if the overall trend was up, and red if the overall trend was down. This chart appeared in a sectioned report so there was a different chart for each section value. Possible? It turns out that there was an answer that works. With minor changes it works in both the desktop and the web products as well.</p>
<p>The eFashion database and universe are used in this demonstration.</p>
<p><span id="more-15"></span></p>
<h3>Solution using Business Objects 6.5</h3>
<p>The first step is to get some data that will support this requirement. I selected the Lines objects from the Product class, the Year from the Time class, and the Sales revenue from the Measures class. Depending on your version of eFashion data you might have slightly different values but the 6.5 version of the database looks like this:</p>
<p><img src="/tips/alerters_on_charts/001_data.gif" width="321" height="201" border="2" alt="Raw data" title="Raw data for Alerters on Charts" /></p>
<p>As you can see from reviewing the data the Accessories product line is in an overall downward trend if you take the first and last year as the only data points. City Skirts is in an upward trent, and City Trousers is again in a downward trend. I don&#8217;t intend to do a true trend analysis with moving averages; I am going to make a very simple definition of &#8220;up&#8221; or &#8220;down&#8221; and use the first year and last year as my only two data points for this tip.</p>
<p>The next step is to create a variable that determines the trend direction. I am going to need a variable because that&#8217;s how I can determine which chart to show later on. The variable is hard-coded in this sample since I know what the end points are. The formula for the variable looks like this:</p>
<p><code>=Sign(&lt;Sales revenue&gt; Where (&lt;Year&gt;="2003") - &lt;Sales revenue&gt; Where (&lt;Year&gt;="2001"))</code></p>
<p>There are two components to this formula. The first is the &#8220;Where&#8221; clause on the measure value. This applies a filter to the revenue so that the value for the measure is filtered to a specified year rather than showing a total. The second component is the <span class="function-name">Sign()</span> function. The <span class="function-name">Sign()</span> function is fairly simple: it returns the numeric sign of the argument. If the argument is any positive value, no matter how big or small, the sign is +1. If the numeric argument is negative, the sign is -1. If the number is zero the sign is zero, and finally if the number is undefined the sign is also undefined.</p>
<p>The results of this formula are shown here:</p>
<p><img src="/tips/alerters_on_charts/002_trend.gif" width="214" height="261" border="2" alt="Trend data" title="Trend data from formula for Alerters on Charts" /></p>
<p>Notice that each product line has an appropriate trend, based on the difference in the 2003 revenues and those for 2001? I will be using this again shortly.</p>
<p>The next step is to set up the chart. For this example I am going to use a simple line chart as it shows the trend in the most obvious fashion. First I created a section on Lines, and then a line chart with Sales revenue and the Year data. Here&#8217;s what the first version of the chart looked like, and I&#8217;m not entirely happy with the results:</p>
<p><img src="/tips/alerters_on_charts/003_basic_chart.gif" width="262" height="611" border="2" alt="First chart" title="First chart for Alerters on Charts" /></p>
<p>What don&#8217;t I like? Because of the difference in scale I can barely see the second chart as it is using the same scale as the first chart. Here is what I would rather see:</p>
<p><img src="/tips/alerters_on_charts/004_adjusted_chart.gif" width="264" height="605" border="2" alt="First chart" title="First chart for Alerters on Charts" /></p>
<p>What I have done here is activate a setting that tells the report to use the scale within each section rather than for the overall report. I think it&#8217;s going to be much easier to read. Here&#8217;s where that setting appears:</p>
<p><img src="/tips/alerters_on_charts/005_adjust_chart_scale.gif" width="450" height="356" border="0" alt="Adjust chart scale" title="Adjust chart scale per section for Alerters on Charts" /></p>
<p>I now have a chart that I like, but it doesn&#8217;t fit the requirement yet. All of the charts are green, even those that are in a downward trend. The next few steps will complete this tip and solve the problem. First, I will duplicate the chart so that I have two identical charts. I will then change the color on the second chart so that it is red. (At the same time I increased the weight of the line just to make the charts more visible.) Here&#8217;s where these steps leave me:</p>
<p><img src="/tips/alerters_on_charts/006_dual_charts.gif" width="450" height="509" border="2" alt="Dual charts" title="Dual charts one green and one red for Alerters on Charts" /></p>
<p>The final step is to ensure that only one of these two charts appears for each section. This is done by right-clicking on the chart, selecting Format Chart, and going to the Appearance tab of this dialog box. I started on the red chart and entered a &#8220;Hide&#8221; formula that looks like this:</p>
<p><code>=&lt;Sales Trend&gt; = 1</code></p>
<p>For the green chart I do something similar but use this formula instead:</p>
<p><code>=&lt;Sales Trend&gt; &lt;&gt; 1</code></p>
<p>Here&#8217;s the screen where this is done:</p>
<p><img src="/tips/alerters_on_charts/007_hide_chart.gif" width="450" height="356" border="0" alt="Hide Chart Feature" title="Hide Chart Feature used on Alerters on Charts" /></p>
<p>What does this do? If the trend is positive then the red chart is hidden. If the sales trend is negative or zero then the green chart is hidden. So I get something like this:</p>
<p><img src="/tips/alerters_on_charts/008_hidden_charts.gif" width="450" height="505" border="2" alt="Hidden Charts" title="Hidden charts used for Alerters on Charts" /></p>
<p>I&#8217;m almost to the end of the technique&#8230; the last step is to carefully size and position the two charts so that they occupy the same space. Since I know only one or the other will ever be displayed I want them to be in exactly the same space. This provides the illusion that there is a chart alerter that is changing the color of the chart based on the trend of the sales data. The reality is there are two charts that switch places. Here is the final output:</p>
<p><img src="/tips/alerters_on_charts/009_final.gif" width="266" height="584" border="2" alt="Final Charts" title="Final result for Alerters on Charts" /></p>
<p>Part II of this article will continue this idea and show how to accomplish the same illusion using techniques available in Web Intelligence.</p>
<h3>Summary</h3>
<p>The purpose of this article was to show how to simulate the appearance of a chart alerter. Since the tools do not provide this feature directly I used a variable and the &#8220;hide block&#8221; feature instead.</p>
<h3>Functions Used</h3>
<ul>
<li>Sign()</li>
</ul>
<h3>Associated Downloads</h3>
<ul>
<li><a href='http://www.dagira.com/wp-content/uploads/2007/08/alerters-on-charts.zip' title='alerters-on-charts.zip'>BusinessObjects 6.5 Sample</a><br />
This download was built using the eFashion sample database provided by Business Objects. It should be accessable to anyone using version 6.5 or higher. The source file is zipped so you will need an unzipping utility to extract the file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2007/07/22/alerters-on-charts/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
