<?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; Web Intelligence</title>
	<atom:link href="http://www.dagira.com/category/report-techniques/web-intelligence/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, 01 Feb 2012 17:26:45 +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>ER Diagram For Web Intelligence Document Structure</title>
		<link>http://www.dagira.com/2011/06/20/er-diagram-for-web-intelligence-document-structure/</link>
		<comments>http://www.dagira.com/2011/06/20/er-diagram-for-web-intelligence-document-structure/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 15:07:05 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=297</guid>
		<description><![CDATA[I recently started participating more on the SAP SCN forums. One question in particular served to remind me that not everybody has a decade (or more) of experience with the tools, and sometimes we need to answer beginner questions too.
For example, someone asked a question along the lines of the following:
I have a document with [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started participating more on the SAP SCN forums. One question in particular served to remind me that not everybody has a decade (or more) of experience with the tools, and sometimes we need to answer beginner questions too.</p>
<p>For example, someone asked a question along the lines of the following:</p>
<blockquote><p>I have a document with three data providers but there are four reports. How can I know which data provider goes with which report, and why are there more reports than data providers?</p></blockquote>
<p>That wasn&#8217;t the exact question, but that was essentially what they were asking. For someone that is new to BusinessObjects it&#8217;s a reasonable question to ask. Especially if they come from a spreadsheet background where everything is right up in front. I thought it might be interesting to set up an Entity &#8211; Relationship Diagram for the various document components to help clarify how things work together. <span id="more-297"></span></p>
<h3>Entities In A Web Intelligence Document</h3>
<p>First I want to identify the various entities (components) of a document. A brief note before I start: the concepts in this post apply equally to Desktop Intelligence and Web Intelligence, but not to Crystal.</p>
<ul>
<li><strong>Document</strong><br />
This is the container object. Everything starts here. The parallel for Excel would be the workbook.</li>
<li><strong>Report</strong><br />
This is the page or &#8220;tab&#8221; in a document. The parallel for Excel would be a worksheet. In Web Intelligence a report tab starts out as a blank canvas. I can include various other report structure items as required.</li>
<li><strong>Block</strong><br />
Here is where the spreadsheet comparison starts to fall apart a bit. A report is a canvas that starts out empty, whereas a spreadsheet starts out with rows and columns. For Web Intelligence the canvas is completely blank and the structure only comes into existence when I create a block. More on that below, but for now let me close by saying there are different types of blocks such as tables, crosstabs, and charts. Is there a parallel with Excel? Sort of. Data in a sheet goes into the existing row / column structure. But it is possible to create a chart that &#8220;floats&#8221; above the worksheet. BusinessObjects uses this floating concept for every block on a report, not just charts.</li>
<li><strong>Cell</strong><br />
I use this term to refer to two things: it can either be a stand-alone cell on a report, or it can be a cell that participates in a block structure. Either way, a cell is something I can click on. With a stand-alone cell I can click on a single cell. In a table I can also, even if it doesn&#8217;t look that way. It may look like I am clicking on an entire column but that&#8217;s not what happens. Viewing the report in Structure Mode helps explain that; more below.</li>
<li><strong>Variable</strong><br />
Ah, <a href="http://www.dagira.com/category/report-techniques/variables/">variables</a>. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Variables are like named formulas in Excel. Variables might be included (displayed) in a cell on a report, but then again, they might not. Crystal does a good job of showing which variables are currently being used. Desktop Intelligence will try to warn me if I try to remove a variable that is in use, but it&#8217;s not always correct. Web Intelligence happily allows me to delete the variable and find out for myself. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  In any case, a variable is a local calculation of some kind. It is not tied to a specific block or report, but it does exist in a single document.</li>
<li><strong>Data Source</strong><br />
There is a subtle difference between a data provider (see below) and a data source. The source is, well, the actual source of the data. It could be a universe. In XI 3.x and earlier versions, a universe generally points to a single database. (There could be exceptions to this statement if Data Federator or techniques like database links are involved, but generally this is a true statement.) In a personal data provider it could be a workbook or a text file.</li>
<li><strong>Data Provider</strong><br />
A data provider, on the other hand, is an &#8220;instance&#8221; of a data source. I can use the same source more than once in the same document simply by creating more than one data provider. To make life really interesting, each data provider can contain more than one SQL statement depending on how your universes are created and configured. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Life is never simple, is it?</li>
</ul>
<h3>Relationships In A Web Intelligence Document</h3>
<p>Now that I have established my list of entities I need to show how they are related to each other. There is essentially a &#8220;many-to-many&#8221; relationship between data providers and blocks. (Please forgive the &#8220;ASCII Art&#8221; version of the ER Diagrams; I wanted to leave everything as text.) The overall structure of a document looks like this:</p>
<pre>
Document -< Report -o< Block -< Cell
                   -o< Cell
</pre>
<p><code>-<</code> is a one to many join<br />
<code>-o<</code> is a one to many outer join, where the right side of the relationship can be missing</p>
<p>What does the above diagram tell me? Each document has to include at least one report (much like a workbook has to include at least one worksheet). One document can have 1 or more reports, and a report can have zero or more blocks. A document can also have (but is not required to have) free-standing cells. A block, if it exists, must contain at least one cell (if it is a tabular format) or chart.</p>
<p>There are various block types, but each block must be exactly one type. These include tables (horizontal or vertical), crosstabs, charts, and forms.</p>
<p>For data it looks like this:</p>
<pre>Document -< Data Source -< Data Provider -< SQL Statement</pre>
<p>What this means is that a document can have one or more data sources. Each source can be used in one or more data providers. And each data provider might generate one or more SQL statements. (I'm not really going to talk about why I might see multiple SQL statements per data provider in this post.)</p>
<p>Finally:</p>
<pre>Data Provider >o-o< Block</pre>
<p>This is what I talked about earlier. Each block can have show results from zero or more data providers, and each data provider can be used in zero or more blocks. Meaning a data provider does not *have* to be used in a block, and a block can consist entirely of made up data (constants, formulas, or variables) and not reference a data provider at all.</p>
<h3>What About Crystal?</h3>
<p>Crystal is a more structured report writing tool. In fact, there is no concept of report blocks in Crystal at all. Instead Crystal uses what I have seen called a "banded" report structure, similar to the way Microsoft Access worked year ago when I last used it for anything. However, there are also similarities in that Crystal can also have more than one data provider, more than one data source, and those sources can be merged onto a single report.</p>
<h3>Conclusion</h3>
<p>I hope this helps new Web Intelligence users understand more about the structure of a document. Some of the concepts are similar to spreadsheets, others are frustratingly different. It all gets better with a little experience.</p>
<p><strong>Related Links</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Ascii_art">Wikipedia on ASCII Art</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2011/06/20/er-diagram-for-web-intelligence-document-structure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Detailing Web Intelligence Document Contents</title>
		<link>http://www.dagira.com/2009/12/11/quick-tip-detailing-web-intelligence-document-contents/</link>
		<comments>http://www.dagira.com/2009/12/11/quick-tip-detailing-web-intelligence-document-contents/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 16:30:50 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=223</guid>
		<description><![CDATA[This tip comes courtesy of Joe Szabo. I met Joe many years ago at a common client. A few weeks ago we had a casual conversation in the hallway at the 2009 GBN conference. I don&#8217;t remember how we got started but the subject of documenting complex Web Intelligence reports came up somehow. I was [...]]]></description>
			<content:encoded><![CDATA[<p>This tip comes courtesy of Joe Szabo. I met Joe many years ago at a common client. A few weeks ago we had a casual conversation in the hallway at the 2009 GBN conference. I don&#8217;t remember how we got started but the subject of documenting complex Web Intelligence reports came up somehow. I was probably complaining and Joe said something like, &#8220;&#8230; but don&#8217;t you just do blah blah blah? That&#8217;s what I do, and it works great.&#8221; This post is going to be all about the &#8220;blah blah blah&#8221; that Joe shared with me. It will help you provide documentation for complex Web Intelligence reports. It will even help debug reports. And best of all, it will help determine exactly what is different between those two different versions of the same report so you can make sure the right version gets migrated into production.</p>
<p>I am going to show screenshots from Web Intelligence 3.0 for this blog post but the same process works in XI R2 as well. <span id="more-223"></span></p>
<h3>Setting Up The Scenario</h3>
<p>To start I need to make sure that my preferences are set for viewing Web Intelligence documents via Infoview in the &#8220;interactive&#8221; viewer. This is done by clicking on the preferences option (in XI R2 it&#8217;s an icon, in 3.x it&#8217;s a text link in the menu bar) and selecting the proper viewer under the Web Intelligence configuration area.</p>
<p>Next I created two documents from the eFashion universe. Or rather I created one document, saved it, made a small change to one formula, and saved it under a new name. Now I have two very similar documents and need to find out what is different. The formula in question is simple enough for this scenario: I take the Sales Revenue and multiply by some factor to get a projection. I specifically did this as a formula rather than a variable for this demonstration. For the second version of the report I changed the projection factor.</p>
<h3>Interactive Viewing Sidebar</h3>
<p><img src="/tips/document_data/sidebar.jpg" class="right" /><br />
Here&#8217;s the trick that Joe shared with me. While viewing the document in interactive mode there are a number of choices that can be made as far as what to show on the left sidebar. The sidebar for 3.0 is shown in the screenshot to the right. It starts out in &#8220;Document Summary&#8221; mode. (Before I go too much further I should note that the same features in XI R2 are selected with a drop-down selector instead of buttons as shown here, but the results are the same.) Document summary shows the name, author, keywords, and other information that can be updated from the &#8220;save&#8221; dialog box or the document properties. It&#8217;s interesting enough, but it doesn&#8217;t help me check for document changes.</p>
<p>But before I go further, look very carefully at what appears just under the sidebar heading&#8230; there is a printer icon. And just in case that isn&#8217;t clear enough, the word &#8220;Print&#8221; also appears. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Clicking the print icon doesn&#8217;t actually print the data shown on the sidebar, at least not right away. What it does is invoke the print process so you can determine how much of the data you want printed.</p>
<p>I will come back to that in a moment. But first, I want to review each of the options presented here as icons and in XI R2 as drop-down selection options.</p>
<p><br clear="all" /><br />
Here are the rest of the icons from 3.0 enlarged to show detail.</p>
<p><img src="/tips/document_data/data_tools.jpg" /></p>
<p>The icons are (from left to right):</p>
<ul>
<li><strong>Document Summary</strong><br />
This pane shows overall document properties, keywords, and other summary information</li>
<li><strong>Data Summary</strong><br />
This pane shows data provider details as well as formulas and variables.</li>
<li><strong>Chart and Table Types</strong><br />
This pane shows templates for various block types. This information is available when creating documents too, of course, but having it available here allows an interactive viewer to change how a report is displayed. Cool stuff.</li>
<li><strong>Available Objects</strong><br />
This pane allows an interactive viewer to see (and therefore drag-and-drop) available objects from a data provider, formulas, or variables onto the report. An interactive viewer can even create new variables on this pane.</li>
<li><strong>Document Structure and Filters</strong><br />
This pane allows an interactive viewer to see the document in &#8220;outline mode&#8221; which shows both page and block layout configuration settings.</li>
<li><strong>Navigation Map</strong><br />
This pane allows a user to navigate through sections on a report. This is driven by the content of the report rather than the structure pane listed above.</li>
<li><strong>User Prompt Input</strong><br />
This pane will allow a user to review prompt selections.</li>
<li><strong>Find</strong><br />
This pane is probably self-explanatory. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s nice to know that it&#8217;s there and I expect to talk more about how it works in a later blog post.</li>
</ul>
<p>So which one of these is the &#8220;magic button&#8221; as far as deciphering document differences?</p>
<h3>Data Summary</h3>
<p>The second button (Data Summary) is where I want to spend the rest of my time for this blog post. When I click that button the outline for my simple document looks like this:</p>
<pre>Data source
 Query 1 

	Universe: eFashion (Oracle)
	Last execution time: 5 s.
	Nb of rows: 1016 

 Objects 

 Query 1 

 	Lines
 	Product line. Each line contains a set of categories. 

 	Quarter
 	Quarter number: Q1, Q2, Q3, Q4. 

 	State
 	State located. 

 	Year
 	Year 1999 - 2001. 

 	Sales revenue
 	Sales revenue $ - $ revenue of SKU sold 

 Formulas 

 	=[Sales revenue] * 1.025 </pre>
<p>Now did I sit here and type all of that into my blog post? Nope. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What I did was click the &#8220;print&#8221; icon. I mentioned this earlier when talking about the Document Summary panel, but it appears on the Data Summary panel as well. Clicking the print icon generates this popup window.</p>
<p><img src="/tips/document_data/print_options.jpg" /></p>
<p>If I leave everything turned on and click the OK button the following content shows up in another window.</p>
<p><img src="/tips/document_data/print_output.jpg" /></p>
<p>Now here&#8217;s the best part. Clearly I can print from this screen. But I can also grab everything and copy / paste into another application. This is very cool stuff. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<h3>Comparing Reports</h3>
<p>I use a text editor called UltraEdit that I am very happy with. One of the many features it has is I can compare two different files. I&#8217;m not saying you have to run out and purchase the same tool I have. All you need is some sort of program that will let you compare the contents of two different files. (If you run unix you have one built in; see the manual page for the diff command for more information.)</p>
<p>I copied the entire contents of the data summary output for version one of my document and saved it as document_v1.txt. Then I did the same to version two and saved it as (of course) document_v2.txt. Finally I ran the compare tool against these two files. I mentioned earlier that the only thing I changed was a single value in one formula. Here&#8217;s what the compare results showed.</p>
<p><img src="/tips/document_data/compare.jpg" /></p>
<p>The only difference between these two Web Intelligence documents is clearly shown. This is nice. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </p>
<h3>What About More Complex Changes?</h3>
<p>There was only one change made for this simple scenario. I added some new objects and a new variable to version 2 of the document and reran the compare using the same steps outlined above and here&#8217;s what I got.</p>
<pre>6	 &lt;! Last execution time: 14 s.
7	 &lt;! Nb of rows: 10272
	 !&gt; Last execution time: 5 s.
	 !&gt; Nb of rows: 1016
22	 &lt;!  Store name
23	 &lt;!  Name of store.
24	 &lt;!
28	 &lt;!  Quantity sold
29	 &lt;!  Quantity sold - number of SKU sold
30	 &lt;!
34	 &lt;!  Document Variables
35	 &lt;!
36	 &lt;!  Test
37	 &lt;!  =[State]
38	 &lt;!
41	 &lt;!  =[Sales revenue] * 1.035
	 !&gt;  =[Sales revenue] * 1.025</pre>
<p>It captured the different run times and row counts. It showed that the Store name object had been added to the second version. It showed that a new variable existed in the second version, and of course it still captured the fact that the constant value was changed from 1.025 to 1.035 in the second version of the document. <em>The way I know this is everything with &lt;! is from the newer &#8220;v2&#8243; version, and everything tagged with !&gt; is from the older &#8220;v1&#8243; text file. That&#8217;s how UltraEdit works. Other tools will likely be different.</em></p>
<p>Now imagine if I were working with a complex document with hundreds of variables and formulas and maybe a dozen or more data providers. I am told that there is &#8220;something different&#8221; about the two documents but I can&#8217;t tell exactly what just from a quick look. I now have a process that will identify exactly what is different as far as data providers, variables, and formulas. That&#8217;s a huge savings in time and effort.</p>
<p>So thanks, Joe, for sharing your tip.</p>
<p><em>As a final note, doesn&#8217;t Joe have a great name for working as a Business Objects consultant? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  His brother Frank won a drawing at one of the Insight conferences in Florida a few years back and the emcee had fun calling out his name. Frank&#8230; ZABO? Is Frank here? Frank Full-Client maybe? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </em></p>
<h3>What About Desktop Intelligence?</h3>
<p>One of the advantages of Desktop Intelligence is that it&#8217;s open to manipulation via VBA. It&#8217;s outside of the scope of this post to provide full details, but I have in the past written code to extract information from various full-client reports and save it into various formats. It would not be a major stretch to apply the same text compare process in order to determine differences between two versions of the same desktop report.</p>
<h3>Conclusion</h3>
<p>Usually when I learn something new I immediately try to see how far I can take it. It turns out that this trick doesn&#8217;t go much further. Of the eight icons on the sidebar only two of them have a print feature: Document Summary and Data Summary. The same techinques could be applied to the output from the document summary but I think the data tab is much more useful. </p>
<p>I should also remind folks that the text editor UltraEdit is not required; it&#8217;s just a tool that I have available. There are many free or inexpensive tools for comparing the contents of two text files. The output from UltraEdit is handy in that it can be color coded (as I showed in the first screenshot) or saved to a text file (which is what I used for the second set of output) instead.</p>
<p>Finally, I hope that I have accomplished one last but important thing with this blog post. Joe seemed really surprised that I had not encountered this feature before. To be honest, I do not spend much time in Infoview. I am usually using the java panel for report development or debugging efforts. Since I don&#8217;t spend much time in Infoview I haven&#8217;t spent that much time checkout out all of the features, and therefore had never seen the &#8220;print&#8221; icon that was available even back in XI R2. </p>
<p>My point is this: <strong>everyone has something to share</strong>. Some of the techniques that you may use every day without thinking twice about them might be new and exciting to someone else. For every person who read this blog post and thought to themself, &#8220;I already knew about that&#8221; I bet there are a dozen or more that are going to say, &#8220;Wow, I never knew I could do that!&#8221; So go ahead and do a presentation for your local user group. Write a blog post. Share something on BOB. Pay it forward. Pass it on. Your mileage may vary. Batteries not included. All that stuff.</p>
<p>You might just save someone else a lot of time, and feel good doing it. <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/12/11/quick-tip-detailing-web-intelligence-document-contents/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<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>Displaying UserResponse() Values On Separate Rows</title>
		<link>http://www.dagira.com/2009/11/25/displaying-userresponse-values-on-separate-rows/</link>
		<comments>http://www.dagira.com/2009/11/25/displaying-userresponse-values-on-separate-rows/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 12:00:22 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=227</guid>
		<description><![CDATA[I am often asked why I still participate so much on BOB after all of these years. The main reason is I still get inspired by questions that make me think a little bit. The puzzle for today&#8217;s post was presented as a question something like this:
How can I display each individual value selected in [...]]]></description>
			<content:encoded><![CDATA[<p>I am often asked why I still participate so much on BOB after all of these years. The main reason is I still get inspired by questions that make me think a little bit. The puzzle for today&#8217;s post was presented as a question something like this:</p>
<blockquote><p>How can I display each individual value selected in the UserResponse() function on its own row in a table?</p></blockquote>
<p>I believe the reason for wanting this behavior is fairly clear. If you have a bunch of complex data it would be much easier for the report consumer to read this:</p>
<p><code>XYZ123ABC<br />
DEF456HIJ<br />
BOB111BOB</code></p>
<p>Instead of this:</p>
<p><code>XYZ123ABC;DEF456HIJ;BOB111BOB</code></p>
<p>As is often the case, the strict answer to the question is &#8220;you can&#8217;t do it that way&#8221; with Web Intelligence. Despite the &#8220;you can&#8217;t&#8230;&#8221; answer I am going to show how it can be done. </p>
<p><span id="more-227"></span></p>
<h3>Printer History Lesson aka Carriage Return + Line Feed To The Rescue</h3>
<p>Before I show my solution, I have a history lesson to share. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  In the old days (and I mean really old, like before laser printers) most business printing was done with impact printers. An impact printer was essentially a typewriter connected to a computer. It would print one character at a time. Some really expensive printers could write an entire line at a time. Some even more expensive ones would be able to write forwards and backwards to save time. Fancy stuff. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' />  But the point is, everything was characters and lines. If a program needed to print something bold, the printer would back up and print the same characters more than once on the same line. That&#8217;s where special printer control characters came in.</p>
<p>The print head or &#8220;carriage&#8221; was where the next character would be printed. Normally it would flow across the page printing one character at a time. At the end of the line, a carriage return signal was sent. This would tell the printer to send the carriage all the way back to the beginning of the line. If the printer started printing again at that point, it would overwrite the existing line of output. (As mentioned above, that&#8217;s one way that bold type was done.) To avoid this, another special printer instruction character was sent just before the printing started: the line feed. This character told the paper to roll the paper forward one line so that the new output would be on the next line.</p>
<p>To recap: carriage return sends the print head back to the left side of the page, and line feed moved the paper forward one line. Carriage return was (and still is) character 13 in the ASCII sequence, and line feed is character 10. (These are also often abbreviated CR and LF.) There are plenty of others. If my memory is correct a tab is character 9 and the &#8220;bell&#8221; if you wanted the printer to make a noise was character 7. But I digress.</p>
<p>Fast forward to today. The characters still retain some of their meanings, even if we don&#8217;t use impact printers anymore. So if I want to push some content down and start on a new line, I can include these characters as part of my output and they will behave the same way. Web Intelligence offers the function <code>Char()</code> which will allow me to introduce a specific character using the proper number. Web Intelligence also offers the <code>Replace()</code> function which will allow me to replace one character (or string) with another character (or string). You might see where all of this is heading&#8230;</p>
<h3>Prompt Processing</h3>
<p>I created a simple query using the Prestige Motors universe. The query includes a prompt that asks the user to select one or more automobile manufacturers when the report is refreshed. The text of the prompt is &#8220;Car Makers.&#8221; I can easily display the results of the prompt (the values the user selected) on my report using the <code>UserResponse()</code> function. What I want to do is display each selected value on its own line.</p>
<p>How am I going to accomplish this? I&#8217;m not going to put each value on an individual row in a table. As I already said that can&#8217;t be done. Instead, I&#8217;m going to make them show up on different rows in a single cell. The readability should be the same, even if the applied technique is different.</p>
<p>The final piece of the puzzle is to observe just how Web Intelligence captures and displays prompt responses. Here is a screen shot showing the prompt after I have selected four different car makers. Notice that the four values are separated by the semicolon ; character.</p>
<p><img src="/tips/response_lines/prompt.jpg" width="395" height="96" border="0" alt="Prompt dialog box" title="Prompt selections shown in a Web Intelligence Rich Client" /></p>
<p>With a simple formula I can echo the prompt selections in my report title cell like this:</p>
<p><img src="/tips/response_lines/standard_output.jpg" width="325" height="174" border="0" alt="Standard report output" title="Web Intelligence Rich Client standard report output from a user response" /></p>
<p>Notice that the exact same format is used in both the prompt window and the output in the title cell. Each selected value is separated by a semicolon. I can work with this.</p>
<h3>The Solution</h3>
<p>I created a variable named &#8220;Picked Cars&#8221; with this formula:</p>
<p><code>=Replace(UserResponse("Car Makers");";";Char(13)+Char(10))</code></p>
<p>The inside portion of the formula looks like this:</p>
<p><code>UserResponse("Car Makers")</code></p>
<p>That bit captures the selections and returns them in the format shown above, where each car name is separated by a semicolon. The outer portion of the formula uses the <code>Replace()</code> function to find those semicolon characters and replace them with the combination of character 13 (CR) and 10 (LF). The net result?</p>
<p>Everywhere there is a ; it gets replaced by the CR+LF and therefore the output moves down to a new line and back to the left side of the page. Strictly speaking there is no page nor is there any paper to &#8220;line feed&#8221; but the functionality is the same. Simple enough. Here&#8217;s what the results looked like after I created this variable and used it in my header.</p>
<p><img src="/tips/response_lines/revised_output.jpg" width="336" height="232" border="0" alt="Alternate report format" title="Web Intelligence Rich Client adjusted user response format" /></p>
<p>What about the formatting? It turns out I didn&#8217;t need to do too much. I made sure that my cell was set to automatically fit the content (since it could grow or shrink based on how many cars were selected) using the &#8220;Autofit Height&#8221; setting as shown here.</p>
<p><img src="/tips/response_lines/cell_properties.jpg" width="600" height="380" border="0" alt="cell properties" title="Web Intelligence Rich Client cell properties with Autofit Height turned on" /></p>
<p>The next item I planned to update turned out to be set for me by default. (This example was documented using the Web Intelligence Rich Client so other tools may require this step.) I clicked on the edge of the block and made sure that if the title cell above it grew too big that the block would move down the page. This is done by setting the relative positioning of the block, as shown here.</p>
<p><img src="/tips/response_lines/block_properties.jpg" width="492" height="324" border="0" alt="block properties" title="Web Intelligence Rich Client block properties for automatic alignment" /></p>
<p>As I mentioned, this dialog box did not require any changes for this scenario. It was already set the way I needed it to be. Since the block is positioned relative to the cell that contains my [Picked Cars] variable it will move up or down the page based on the size (height in this case) of the cell.</p>
<h3>Conclusion</h3>
<p>Can I split out each individual user response and display it on a separate row in a table? No. Can I achieve the same visual result using other techniques? Sure. That&#8217;s what it&#8217;s all about, finding a different way to answer a question. This solution does have one problem&#8230; it will not work cleanly if there are semicolon characters in the data returned from the prompt. I did not test this with Desktop Intelligence, but since it includes all of the functions used in this example I am confident that it would work the same way.</p>
<p>I was challenged when I posted this solution on BOB as to why I used both CR and LF characters in my formula. To be honest, when I changed the formula so that it only included one or the other, either seemed to work just fine individually. Despite this, I opted to leave both in my formula.</p>
<p>What can I say&#8230; old habits die hard. <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/11/25/displaying-userresponse-values-on-separate-rows/feed/</wfw:commentRss>
		<slash:comments>32</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[Multiple Data Providers]]></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>32</slash:comments>
		</item>
		<item>
		<title>Calculating Business Days Between Two Days Via Report Functions</title>
		<link>http://www.dagira.com/2009/10/23/calculating-business-days-between-two-days-via-report-functions/</link>
		<comments>http://www.dagira.com/2009/10/23/calculating-business-days-between-two-days-via-report-functions/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 00:57:50 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[2009 GBN - Dallas]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=160</guid>
		<description><![CDATA[A frequently asked question on BOB is:
How can I calculate the number of business days between two dates?
The easiest answer is to use a calendar table with a flag for business days because that takes care of everything quite easily. You can even mark holidays along with weekend days and make the results more useful.
But [...]]]></description>
			<content:encoded><![CDATA[<p>A frequently asked question on <a href="http://busobj.forumtopics.com">BOB</a> is:</p>
<blockquote><p>How can I calculate the number of business days between two dates?</p></blockquote>
<p>The easiest answer is to use a calendar table with a flag for business days because that takes care of everything quite easily. You can even mark holidays along with weekend days and make the results more useful.</p>
<p>But suppose you don&#8217;t have a calendar table. Suppose you don&#8217;t care about holidays, you simply want to count the number of Monday &#8211; Friday days between a range of dates. Can you do that?</p>
<p>The answer is coming if you read the rest of the post. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><em>Note: This technique was shown in public on Monday at the GBN conference. I had written this blog post some time ago but waited to release it until after the presentation had been delivered. The presentation has been uploaded to my blog and is available for download from the <a href="http://www.dagira.com/conference-presentations/">conference page</a>.</em></p>
<p><span id="more-160"></span></p>
<h3>Web Intelligence Functions Required</h3>
<p>This formula is going to use the following functions, so I will introduce and describe each of them a bit here.</p>
<ul>
<li><strong>DaysBetween()</strong><br />
Input values: two date values<br />
Output value: an integer number (no fractions) showing the number of days between the two dates</li>
<li><strong>DayNumberOfWeek()</strong><br />
Input value: date<br />
Output value: Number from 1 to 7 denoting the day of week (1 = Monday, 7 = Sunday)</li>
<li><strong>Truncate()</strong><br />
Input value: numeric expression or value, number of desired decimal places<br />
Output value: numeric value truncated to specified number of decimals, for example Truncate(3.14159, 2) = 3.14<br />
Truncate does not round, so Truncate(5.9; 0) returns 5 which is what is needed for this solution</li>
<li><strong>Mod()</strong><br />
Input value: two numbers<br />
Output value: the remainder of the first value divided by the second<br />
Example: Mod(10; 2) = 0 and Mod(11; 2) = 1 and Mod(15; 7) = 1</li>
<li><strong>Substr()</strong><br />
Input value: string, starting position, length<br />
Output value: part of the string<br />
Example: Substr(&#8217;1234&#8242;;2;1) = &#8216;2&#8242;</li>
<li><strong>ToNumber()</strong><br />
Input value: string representation of a valid number<br />
Output value: number<br />
Example: ToNumber(&#8217;2&#8242;) = 2</li>
</ul>
<h3>Counting Weeks</h3>
<p>One of the first steps in solving any sort of calculation is to look for shortcuts. Clearly there will be an infinite number of input values for my calculation so I need some way to avoid too many possible choices. Because of this I am going to start by counting the number of weeks between two days.</p>
<p>Take a look at the calendar on the right-side of my blog and try an experiment. It turns out that no matter which day of the week you start on, if you run for seven days you are guaranteed to get exactly two weekend dates. No more, no less, exactly two. Try it out and see. Start on a Sunday and count forward seven days and what do you get? Exactly one Sunday and one Saturday = two weekend days. Start on Monday and count forward seven days and the same thing happens. Start on Tuesday&#8230; on Friday, or even Saturday&#8230; and any range of seven days always has exactly two weekend dates included.</p>
<p>I can extend this to any multiple of seven days. If I have 14 days I get 4 weekend days. With 21 days I have 6 weekend days. If I multiply by five instead of two I get the number of weekdays in the range, therefore I am going to start my calculation using this pattern. Here is the start of the formula:</p>
<p><code>Truncate(DaysBetween([Start Date]; [End Date]) / 7 ; 0)</code></p>
<p>Let me break that down. First the <code>DaysBetween()</code> function is used to determine the number of days between the starting and ending dates for my range. Next I divide the number of days by seven which will result in a decimal result. For example, <code>15 / 7 = 2.14</code>. Finally I use the <code>Truncate()</code> function to remove the decimal, which converts 2.14 to 2. That gives me the number of full weeks between my two days. Here&#8217;s a table showing results for some sample day ranges.</p>
<table class="blogtable">
<tr>
<th>Number of Days</th>
<th>Number of Whole Weeks</th>
<tr class="alt">
<td class="code">3</td>
<td class="code">0</td>
</tr>
<tr>
<td class="code">5</td>
<td class="code">0</td>
</tr>
<tr class="alt">
<td class="code">7</td>
<td class="code">1</td>
</tr>
<tr>
<td class="code">8</td>
<td class="code">1</td>
</tr>
<tr class="alt">
<td class="code">13</td>
<td class="code">1</td>
</tr>
<tr>
<td class="code">14</td>
<td class="code">2</td>
</tr>
<tr class="alt">
<td class="code">15</td>
<td class="code">2</td>
</tr>
<tr>
<td class="code">20</td>
<td class="code">2</td>
</tr>
<tr class="alt">
<td class="code">21</td>
<td class="code">3</td>
</tr>
<tr>
<td class="code">22</td>
<td class="code">3</td>
</tr>
</table>
<p>Based on the conclusion I made earlier, I can use the number of weeks and multiply by five to get the number of week days included in the range. In order to get that number I make one small modification to the formula presented above; I multiply the result by five. The result:</p>
<p><code>Truncate(DaysBetween([Start Date]; [End Date]) / 7 ; 0) * 5</code></p>
<p>All I have left to deal with are the leftover of days that don&#8217;t make up a full week. The decimal part of 2.14 is 0.14 which represents one extra day in my range. In order to know whether to count that day or not, I have to know the <strong>name</strong> (or alternatively the number) of the day my range starts on.</p>
<h3>How Many Extra Days</h3>
<p>There is a function called <code>DayNumberOfWeek()</code>. It numbers Monday as 1 and Sunday as 7 so I&#8217;m going to pretend that my calendar looks like this:</p>
<p><code>M T W T F S S<br />
1 2 3 4 5 6 7</code></p>
<p>What I need to get next is the number of days that are <strong>not</strong> a full week. I used the <code>Truncate()</code> command earlier to get the number of full weeks. It removes the decimal part of the division result. What I need now is the decimal part, and the <code>Mod()</code> function can be used to get it. This function does a division and returns the remainder. The first argument will be the total number of days, and the second argument will be seven as there are seven days in a week. The result will be a number that ranges from zero (0) to six (6) because those are the only possible remainder values when dividing by sevent. </p>
<p>For example, <code>Mod(15; 7) = 1</code>. 15 / 7 is 2 with 1 left over, therefore 1 is the return value from the <code>Mod()</code> function. To apply that to my current problem: 15 days is made up of two full weeks and one extra day. Twenty days would be <code>Mod(20; 7)</code> which results in 6 remaining days. <code>Mod(21; 7)</code> is zero because there are exactly three weeks and no extra days.</p>
<p>Can I put these two pieces of information together? I can easily get the number of the day in the week, and I know how many extra days there are. I should be able to do some math&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/10/23/calculating-business-days-between-two-days-via-report-functions/feed/</wfw:commentRss>
		<slash:comments>31</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>22</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>14</slash:comments>
		</item>
		<item>
		<title>Java Memory Errors During Data Provider Updates in Web Intelligence</title>
		<link>http://www.dagira.com/2009/04/16/java-memory-errors-during-data-provider-updates-in-web-intelligence/</link>
		<comments>http://www.dagira.com/2009/04/16/java-memory-errors-during-data-provider-updates-in-web-intelligence/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 22:00:29 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=148</guid>
		<description><![CDATA[Changing Data Providers in Complex Reports
We have some fairly complex reports at my current client. Of course the word &#8220;complex&#8221; is not very clear; what is simple to me might be complex to someone else. So let me quantify what I mean by &#8220;complex&#8221; in this case. The report in question has multiple data provders. [...]]]></description>
			<content:encoded><![CDATA[<h3>Changing Data Providers in Complex Reports</h3>
<p>We have some fairly complex reports at my current client. Of course the word &#8220;complex&#8221; is not very clear; what is simple to me might be complex to someone else. So let me quantify what I mean by &#8220;complex&#8221; in this case. The report in question has multiple data provders. Each data provider generates multi-pass SQL because of contexts. Altogether there are 29 data providers with an overall total of over 100 SQL passes. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_eek.gif' alt=':shock:' class='wp-smiley' />  That&#8217;s what I mean by a &#8220;complex&#8221; report, and I think most folks would agree with that assessment.</p>
<p>The challenge is that for this (and other) complex reports we have been encountering severe issues. In some cases we are unable to edit the queries without restarting our browser session. We also have encountered a number of problems during the process of repointing the document from one universe (development) to another (user acceptance testing) within the same environment. <span id="more-148"></span></p>
<p>Current versions of Web Intelligence offer the ability to repoint a document using the following steps:</p>
<ul>
<li>Open the report</li>
<li>Edit the query</li>
<li>Click the [...] button next to the universe in use</li>
<li>Select the desired destination universe from the list</li>
<li>Review the object mapping and click OK to continue</li>
</ul>
<p><em>Side note: I really <strong>really</strong> like the fact that I can remap individual objects rather than having the process fail as a result of something being missing, but that&#8217;s another blog post&#8230;</em></p>
<p>Our problem is that after performing the steps listed above, we wait. And wait. And wait. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  Eventually the session times out. Finally (after much beating of head on desk) I remembered to activate the Java console. (Click <strong>Tools</strong> and then <strong>Sun Java Console</strong> from the Internet Explorer menu bar to start the console.) The console shows what&#8217;s going on within the Java environment. It seems that I was running out of memory during the attempt to switch universes, and Webi was not capturing the exception properly. Instead of letting me know there was an issue, it was simply&#8230; not responding. Nice.</p>
<h3>Setting Java Heap Size</h3>
<p>Long story short, the memory exception was related to the heap size. So I did some searching on the Sun Java forums and found a number of tips about how to increase this parameter. The exact process will be different based on the version of the JRE that you are using, but the desired parameter is the same either way. If you open a command window and type <code>java -X</code> (which is case sensitve, it must be a capital &#8220;X&#8221;) the program will return a list of valid parameters. For my version I got this:</p>
<pre>java -X
    -Xmixed           mixed mode execution (default)
    -Xint             interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by ;>
                      set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                      append to end of bootstrap class path
    -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                      prepend in front of bootstrap class path
    -Xnoclassgc       disable class garbage collection
    -Xincgc           enable incremental garbage collection
    -Xloggc:<file>    log GC status to a file with time stamps
    -Xbatch           disable background compilation
    -Xms<size>        set initial Java heap size
    -Xmx<size>        set maximum Java heap size
    -Xss<size>        set java thread stack size
    -Xprof            output cpu profiling data
    -Xrunhprof[:help]|[:<option>=<value>, ...]
                      perform JVMPI heap, cpu, or monitor profiling
    -Xdebug           enable remote debugging
    -Xfuture          enable strictest checks, anticipating future default
    -Xrs              reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni       perform additional checks for JNI functions

The -X options are non-standard and subject to change without notice.</pre>
<p>The one I am interested in is <code>Xmx<size></code> which can be used to adjust the maximum heap size used by the JVM. Based on some reading, setting this value too high can be just as bad as having it set too low, so I didn&#8217;t want to go nuts right away. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I tried several different values, using my complex report as a test case, and ultimately found that 128m was just fine for me.</p>
<p>The screen used to update this changes based on the version of Java that you are using. I have included screen shots for both 1.4.2 and 1.5 at the end of this blog post.</p>
<h3>Conclusion</h3>
<p>After making this simple change I was not only able to change the data provider source for my complicated report, but other operations became much more stable as well. I also think that many operations were faster.</p>
<p>Or maybe it was just the fact that they completed at all that made them seem faster. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><strong>Java 1.4.2 Heap Configuration</strong></p>
<p><img src="/tips/jvm_heap/java.1.4.2.jpg" /></p>
<p><strong>Java 1.5.0 Heap Configuration</strong></p>
<p><img src="/tips/jvm_heap/java.1.5.0.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/04/16/java-memory-errors-during-data-provider-updates-in-web-intelligence/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Java 1.6 / 6.0 Update Issue</title>
		<link>http://www.dagira.com/2007/08/14/java-16-60-update-issue/</link>
		<comments>http://www.dagira.com/2007/08/14/java-16-60-update-issue/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 14:26:50 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Intelligence]]></category>

		<guid isPermaLink="false">http://www.dagira.com/2007/08/14/java-16-60-update-issue/</guid>
		<description><![CDATA[The Evils of Automatic Software Updates
A few months ago about half of the reporting team at my current client called me at various times over a week saying they were having problems running reports. Eventually I figured it out&#8230; they all had one thing in common: automatic Java updates. Turns out that was a Very [...]]]></description>
			<content:encoded><![CDATA[<h3>The Evils of Automatic Software Updates</h3>
<p>A few months ago about half of the reporting team at my current client called me at various times over a week saying they were having problems running reports. Eventually I figured it out&#8230; they all had one thing in common: automatic Java updates. Turns out that was a Very Bad Thing™ to do. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-22"></span></p>
<p>As these folks were using their computers it seemed that the Java application was busy in the background checking in with the mother ship. Since version 6.0 (aka 1.6) had been released, the Java-bot dutifully went about upgrading the system. The problem is, version 1.6 of the JRE doesn&#8217;t play nicely with Web Intelligence. The primary symptom? You can&#8217;t get a prompt window to display. </p>
<p>I have seen this manifest it self in two ways. First, you cannot run queries that include prompts. These can be prompts built in the query panel itself, predefined conditions, or even automatic prompts embedded in the universe. Second, if you have the &#8220;refresh on open&#8221; property turned on you cannot even click on the &#8220;Modify&#8221; link to open the document in the Java query panel. It wants to work, and it tries to load, but it will get stuck on the &#8220;Building interface&#8221; step shown on the splash screen. Very frustrating, and not really a good indication of what the underlying issue is either.</p>
<h3>Turning Off Automatic Updates</h3>
<p>So here&#8217;s how to turn off Java automatic updates. If you look in your Windows system tray (it&#8217;s the part of your task bar where all the icons appear that show you how much of your system RAM you&#8217;re wasting on trivial stuff like the Weather Bug <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) there will be a Java cup. If you right-click on that icon you can open the properties. Here is where you want to go to disable the automatic updates:</p>
<p><img src="/tips/java_1.6/auto_update.jpg" width="450" border="0" alt="Autoupdate" title="How to turn off java automatic updates" /></p>
<p>The screen capture above is taken from Java 1.4.2_04 and shows where the checkbox is hidden. If you clear that checkbox you will only get upgraded when you want to, and you also will not be nagged about pending updates. Java 1.4.2_04 is what you get from Web Intelligence XI (current versions as I write this, that may change in the future) when you first load the Java query panel.</p>
<h3>Getting Java 1.4.2 back</h3>
<p>Finally, here is a link to download older Java versions. What you need are the JRE (Java Runtime Environment) 1.4.2 or 1.5 (aka 5.0). Version 1.6 (aka 6.0) is not supported by Web Intelligence as of XI Release 2 Service Pack 2.</p>
<p><a href="http://java.sun.com/products/archive/">http://java.sun.com/products/archive/</a></p>
<p>And on additional bonus: if you don&#8217;t want to see the java cup taking up space in your system tray, there is an option for that as well. Here&#8217;s a screen shot showing where that setting is:</p>
<p><img src="/tips/java_1.6/system_tray.jpg" width="450" height="226" border="0" alt="system tray" title="Turning off the java icon in your system tray" /></p>
<p><strong>Edited on September 4, 2007</strong><br />
It just occurred to me while answering a post on BOB that you don&#8217;t really need the download links I provided above. If you remove all of the Java JRE programs from your system then Web Intelligence will automatically push down a supported version the next time you load the java query panel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2007/08/14/java-16-60-update-issue/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

