<?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; Report Techniques</title>
	<atom:link href="http://www.dagira.com/category/report-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagira.com</link>
	<description>...you are in a twisty maze of passageways, all different...</description>
	<lastBuildDate>Wed, 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>Want To Remove Drill Indicators? Use A Variable&#8230;</title>
		<link>http://www.dagira.com/2010/07/07/want-to-remove-drill-indicators-use-a-variable/</link>
		<comments>http://www.dagira.com/2010/07/07/want-to-remove-drill-indicators-use-a-variable/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 12:38:54 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=298</guid>
		<description><![CDATA[In some cases I have created reports that were in drill mode that were not really drillable. For example, I showed a technique a few years back that would let a report developer swap measures out on a chart using a drill filter. It has been working great for quite a few years now. However, [...]]]></description>
			<content:encoded><![CDATA[<p>In some cases I have created reports that were in drill mode that were not really drillable. For example, I showed a technique a few years back that would let a report developer swap measures out on a chart using a drill filter. It has been working great for quite a few years now. However, as a side effect any dimension on the report blocks that participates in a hierarchy becomes drillable. Sometimes I don&#8217;t want that, and there is an easy fix. <span id="more-298"></span></p>
<h3>Problem Definition</h3>
<p>When building a universe there are three types of result objects that I can build: dimensions, details, and measures. All dimensions are by default drillable, and the order of the objects in the class determines the default hierarchy. (That&#8217;s one of many reasons why trying to order objects in alphabetical order just does not work.) I can eliminate the default hierarchies (and allow my objects to be ordered alphabetically if I really need to) by creating custom hierarchies. That&#8217;s a subject for another blog post.</p>
<p>What I want to talk about today is how to eliminate all drill opportunities on a report, no matter whether I have used default or custom hierarchies. I want to be able to include dimension objects, put my report into drill mode, but not be able to drill on every possible dimension. Here&#8217;s how to do that.</p>
<h3>Demote the Dimension Using a Variable</h3>
<p>When I use a dimension object in my block and that dimension participates in a drill hierarchy and my report is in drill mode I will see the drill indicators. In the Web Intelligence Rich Client they look like this:</p>
<p><img src="/tips/drill_variable/drill_filter.png" width="325" height="100" border="0" alt="Screen shot showing drillable block in Web Intelligence" title="Indicators that a block is drillable in a Web Intelligence document" /></p>
<p>The &#8220;up arrow&#8221; implies that I can drill up. The underline format on the resort names implies that I can drill down. Here is a very simple fix if I don&#8217;t want either of those interface elements to appear. Create a variable that references the dimension, and use the variable instead. For this example, I will create a variable called Resort Name that has the simple formula <code>=[Resort]</code>. Once I do that, and I replace the original Resort object with my new variable, here is what the block looks like when the report is in drill mode:</p>
<p><img src="/tips/drill_variable/no_drill.png" width="325" height="100" border="0" alt="Screen shot showing non-drillable block in Web Intelligence" title="After demotion the column (variable) is no longer drillable" /></p>
<p>Problem solved. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> The reason this works is that variables &#8211; even simple ones like this &#8211; are not drillable. Only dimension objects that come from the universe can be drilled. By converting a dimension to a variable it will no longer show any drill indicators when a report block is in drill mode. Why would I want to do that? As mentioned in the first paragraph of this post, I showed a trick several years ago that allows me to switch measures on a block by changing a selection in a drill filter. In order to do that, the report has to be in drill mode. I will write up that one soon, or you can read about it in Tales of a Universe Ninja, Part II, found on my <a href="http://www.dagira.com/conference-presentations/">conference presentations page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2010/07/07/want-to-remove-drill-indicators-use-a-variable/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>What Does Extend Merged Dimensions Really Do?</title>
		<link>http://www.dagira.com/2010/06/19/what-does-extend-merged-dimensions-really-do/</link>
		<comments>http://www.dagira.com/2010/06/19/what-does-extend-merged-dimensions-really-do/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 18:19:31 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Multiple Data Providers]]></category>
		<category><![CDATA[Report Techniques]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=292</guid>
		<description><![CDATA[The &#8220;Extend merged dimension values&#8221; is designed to provide more flexibility in how Web Intelligence handles merged data. In Desktop Intelligence we have for years complained that there is no way to control the merge (join) process. No matter what I did I got a full outer join. In the XI versions of Web Intelligence, [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8220;Extend merged dimension values&#8221; is designed to provide more flexibility in how Web Intelligence handles merged data. In Desktop Intelligence we have for years complained that there is no way to control the merge (join) process. No matter what I did I got a full outer join. In the XI versions of Web Intelligence, I now have three different ways to reference my merged values. In this post I will show those three options and then show the impact of the extend merged dimension setting. <span id="more-292"></span></p>
<h3>Defining the Problem</h3>
<p>I am going to create a couple of very simple queries from the Island Resorts universe to demonstrate this feature. Each query is specifically structured so that it is missing some data found in the other query. For example, here is my first query.</p>
<p><img src="/tips/extend_merge/query_left.png" width="247" height="194" border="0" alt="Screen shot of Web Intelligence query panel" title="Web Intelligence query panel returning data for 2007-2008" /></p>
<p>And the data returned by this query.</p>
<p><img src="/tips/extend_merge/data_left.png" width="325" height="169" border="0" alt="Screen shot of Web Intelligence data" title="Web Intelligence data for 2007-2008" /></p>
<p>And here is my second query.</p>
<p><img src="/tips/extend_merge/query_right.png" width="275" height="201" border="0" alt="Screen shot of Web Intelligence query panel" title="Web Intelligence query panel returning data for 2006-2007" /></p>
<p>And the data returned by this query.</p>
<p><img src="/tips/extend_merge/data_right.png" width="325" height="169" border="0" alt="Screen shot of Web Intelligence data" title="Web Intelligence data for 2006-2007" /></p>
<p>I am going to call the first query my &#8220;left&#8221; query and the second query is my &#8220;right&#8221; query for the rest of this post. I have specifically restricted my left query to 2007-2008 years of data, and my right query to 2006-2007. That means the two queries have one year (2007) in common and each query also has unique data (left has 2008 and right has 2006).</p>
<p>Since both queries are from the same source I do not have to do anything to merge the shared dimensions. Both the Resort and Year are automatically merged as shown here.</p>
<p><img src="/tips/extend_merge/merged_dimensions.png" width="219" height="199" border="0" alt="Merged dimensions from a Web Intelligence document" title="Shared dimensions in a Web Intelligence document are automatically merged" /></p>
<p>And finally here is the resulting block of data shown in my Web Intelligence report. This is the most common presentation for the data. Note that it shows data from all three years of sales results that I selected.</p>
<p><img src="/tips/extend_merge/merged_block.png" width="433" height="241" border="0" alt="Merged dimensions shown in a Web Intelligence document" title="Shared dimensions mean that all data is shown from all data providers on a merged block in Web Intelligence" /></p>
<h3>Using the Left Query to Drive The Results</h3>
<p>In Desktop Intelligence (more details below) this is as far as I can go. I don&#8217;t have any options that let me control the merge process. In Web Intelligence I do. What if  I want my first query (left) to drive the results? All I have to do is open up each merged dimension object and use the dimensions that come from the left query. If I do, here&#8217;s what the block looks like.</p>
<p><img src="/tips/extend_merge/left_block.png" width="433" height="169" border="0" alt="Screen shot of a Web Intelligence block showing priority given to the left side of the merged queries" title="Web Intelligence block driven by the left query" /></p>
<p>What is going on here? The left query had 2007-2008 data only. I see annual data for both of those years for all three resorts. However, the 2008 rows are missing the Number of guests values. They don&#8217;t exist, because the right query only goes up to 2007. In this case I have told Web Intelligence that my &#8220;left&#8221; data is more important, and to show right data only where it exists.</p>
<h3>Using the Right Query to Drive The Results</h3>
<p>Next I will turn things around and use the &#8220;right&#8221; dimensions instead. Here is the block that results from that operation.</p>
<p><img src="/tips/extend_merge/right_block.png" width="433" height="169" border="0" alt="Screen shot of a Web Intelligence block showing priority given to the right side of the merged queries" title="Web Intelligence block driven by the right query" /></p>
<p>Now my revenue column is sparse (has missing values) while the Number of guests column is completely populated. That is what I expect given that I am using the right dimension objects this time.</p>
<p>Those are the three options that I have in Web Intelligence. I can use the merged dimensions (the most typical requirement) or I can use the dimensions from a specific data provider. If I compare the three blocks (merged, left, and right) I can see exactly how Web Intelligence is working. How does Desktop Intelligence work?</p>
<h3>Merging Data in Desktop Intelligence</h3>
<p>In my example Web Intelligence report I have selected the Resort object in two different queries. After the automatic merging process has run I end up with three different ways to reference the Resort values on a report. Specifically I can reference Resort(left), Resort(right), or Resort. The last option is the merged result. In Desktop Intelligence I am missing that last choice. Is that a problem?</p>
<p>I have a screen shot that shows what the merging process looks like in Desktop Intelligence. One complaint that I have is that I have to click on each dimension object individually to see if it is linked or not. In the screen shot shown below I am only showing that the two year values are linked.</p>
<p><img src="/tips/extend_merge/deski_merge.png" width="546" height="397" border="0" alt="Screen shot of Desktop Intelligence merge dimension process" title="Desktop Intelligence merge dimension process" /></p>
<p>Next I notice that I have no way to refer to the merged result set as I do in Web  Intelligence. I have to pick either the left or right value. Does it matter? It turns out that it does not, as shown here. I have selected the right version of the Year object, yet all three values are showing up. </p>
<p><img src="/tips/extend_merge/deski_block.png" width="428" height="201" border="0" alt="Desktop Intelligence merge dimension results" title="Desktop Intelligence merge dimension result block" /></p>
<p>In Desktop Intelligence the results from the left and right queries are merged together. Every value from the left query appears on the right, and every value on the right appears on the left. It is a union of the two data providers. As a result of this union operation, it doesn&#8217;t matter which side I pick. I can swap the left and right dimension values and still get the same result. It is always a full outer join.</p>
<p>Is it possible for me to reproduce the way Web Intelligence behaves in Desktop Intelligence? In the example I am using today, the answer is yes. However, I need to look at the measure values instead of the dimensions since I cannot alter the merged dimension behavior. If I want to show the left data, I can create a filter so that only those rows that include a Revenue value will be displayed. Here is how that filter looks.</p>
<p><img src="/tips/extend_merge/deski_filter_left.png" width="494" height="412" border="0" alt="Screen shot of Desktop Intelligence complex filter creation process" title="Creating a complex filter in a Desktop Intelligence merged block" /></p>
<p>Dimension values will never be NULL in Desktop Intelligence because of the way the values are shared as a result of the merging process. If I can identify a measure, as I did in this case, I can essentially create a left or right block based on my requirements. The process is not intuitive, nor is it effective in every case. </p>
<h3>Extend Merged Dimension Values</h3>
<p>So now to the point of this post: what if I would like Web Intelligence to act more like Desktop Intelligence? That&#8217;s exactly what the setting &#8220;Extend merged dimension values&#8221; does for me. Remember in my description of Desktop Intelligence I said that merged dimensions result in a union, where every value from my left query appears in my right dimension and vice versa. That means that I will always see data from either side, no matter which dimension I pick. Here is one way to invoke this setting. I am right-clicking on a report tab and I see this menu.</p>
<p><img src="/tips/extend_merge/invoke_document_properties.png" width="248" height="229" border="0" alt="Screen shot of context menu in a Web Intelligence document" title="Invoking the context (right-click) menu in a Web Intelligence document" /></p>
<p>After selecting Document Properties the following menu appears on the side of my document.</p>
<p><img src="/tips/extend_merge/extend_merge_setting.png" width="245" height="93" border="0" alt="Screen shot of document properties in a Web Intelligence document" title="Document properties in a Web Intelligence document" /></p>
<p>The setting is off by default. What happens if I turn it on?</p>
<p>Here is what my left block looked like before the setting was turned on.<br />
<img src="/tips/extend_merge/left_block.png" width="433" height="169" border="0" alt="Screen shot of a Web Intelligence block showing priority given to the left side of the merged queries" title="Web Intelligence block driven by the left query" /></p>
<p>And here is what it looked like afterwards.<br />
<img src="/tips/extend_merge/left_block_extended.png" width="433" height="241" border="0" alt="Screen shot of a Web Intelligence block showing the results of extended merged dimensions" title="Web Intelligence block driven by the left query with extend merged dimensions activate" /></p>
<p>And here is the right block.</p>
<p><img src="/tips/extend_merge/right_block_extended.png" width="433" height="241" border="0" alt="Screen shot of a Web Intelligence block showing the results of extended merged dimensions" title="Web Intelligence block driven by the right query with extend merged dimensions activate" /></p>
<p>They look exactly the same. And that&#8217;s how Desktop Intelligence would have behaved in this situation. Each dimension has been extended to include the values from the other. My left year includes right values, and my right year includes left values. I have recreated the Desktop Intelligence behavior in Web Intelligence. I am not sure this is a good thing, but I can do it. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Conclusion</h3>
<p>If I only use the merged dimension (meaning I use Resort instead of Resort(Left) or Resort(Right)) then this setting doesn&#8217;t do anything for me. The results will be the same with the setting on or off. But if I need to pick the specific values from either the left or right, this setting allows me to recreate the behavior found in Desktop Intelligence. </p>
<p>One caveat: this setting is a document setting, not a report setting. That means if I turn it on (or off) it affects the entire document. That may or may not be an issue. It all depends on what I am trying to do.</p>
<p><em>This post was written in response to a <a href="http://www.forumtopics.com/busobj/viewtopic.php?t=156975">specific topic on BOB</a>. I started to write the answer there but realized it would make much more sense with screen shots and more text.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2010/06/19/what-does-extend-merged-dimensions-really-do/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Calculation Context Part I: Overview</title>
		<link>http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/</link>
		<comments>http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:28:10 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Calculation Context]]></category>
		<category><![CDATA[Report Techniques]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=229</guid>
		<description><![CDATA[One of the hardest concepts to explain when introducing new folks to Business Objects is context. 
I now imagine blog readers who have been working with the tools for a while have started nodding their heads in agreement, only to stop and say, &#8220;Hey, wait a second, is Dave talking about universe contexts or report [...]]]></description>
			<content:encoded><![CDATA[<p>One of the hardest concepts to explain when introducing new folks to Business Objects is context. </p>
<p><em>I now imagine blog readers who have been working with the tools for a while have started nodding their heads in agreement, only to stop and say, &#8220;Hey, wait a second, is Dave talking about universe contexts or report calculation contexts?&#8221; </em></p>
<p>And the answer is, of course, yes. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </p>
<p>Both concepts can be quite complicated and take a while to fully understand. Since I have already written a number of blog posts about universe contexts I thought it was time to turn my attention to the report technique of calculation contexts. Note that this concept is used in Desktop Intelligence and Web Intelligence but not in Crystal. This post is intended to be an overview only. I have plans for a detailed post on each of the various context operators where I will go into much more depth. For this post my goal is to introduce the concept and provide some basic definitions. <span id="more-229"></span></p>
<h3>Introducing Calculation Context</h3>
<p>The default calculation context is defined by the dimensions that participate in a report block. It is this feature that makes the dynamic nature of measures possible. When dimensions are removed from or added to a block the context changes and the measure amounts also change. This is controlled by the <a href="http://www.dagira.com/2009/07/06/sql-aggregate-versus-universe-projection/">projection function set on each measure</a> by the universe designer.</p>
<p>However, a report writer sometimes wants a measure to be fixed at a particular value. Percentages are a really simple example. To calculate a contribution percentage I need to divide each individual value by the overall grand total. In order to do that, I need to know how to generate the grand total anywhere I want it. In order to do <strong>that</strong>, I need to understand how to use the various calculation context operators.</p>
<h3>Context Operators</h3>
<p>There is a simple (but powerful) set of context operators that I can choose from. I intend to briefly define each one in this blog post and then dive into more detail in future posts. As I mentioned when I started, the default context for a measure is based on the dimension values present in the block structure. I can alter which of those dimensions impact the calculation using one of the following three context operators.</p>
<ul>
<li><strong>In</strong> is used to specify exactly which dimensions to include in a context. Other dimensions in the block are ignored. Adding / removing elements from the block does not impact this calculation unless a removed dimension was specified in the context. In that case a #MULTIVALUE error is displayed.</li>
<li><strong>ForEach</strong> is used to <em>include</em> a dimension in a context. The calculation context is still affected by other values in the block.</li>
<li><strong>ForAll</strong> is used to <em>exclude</em> a dimension from a context. Other dimensions of the block will still be considered. Adding or removing values from a block might change the value, but it will always ignore the ForAll items.</li>
</ul>
<p>The operators listed above all require one or more dimensions as part of their syntax. However, calculation context can be specified by more than a set of dimension values. There are a series of report structure keywords that can be used as well.</p>
<ul>
<li><strong>In Report</strong> sets the context at the report or &#8220;grand total&#8221; level. Any formula with these keywords for the context will return an overall total. Note that the total may still be affected by report filters.</li>
<li><strong>In Block</strong> sets the context for each <del datetime="2009-12-04T22:01:55+00:00">block</del> section. For years I have been waiting for this setting to be renamed to reflect how it really works, but it hasn&#8217;t. I suppose it&#8217;s for backwards compatibility. If there is only one block on a report then &#8220;In Block&#8221; and &#8220;In Report&#8221; are going to be the same. But when a block is broken up into sections, then this context will generate a total for each section value. For that reason I submit that a better name might have been &#8220;In Section&#8221; instead, but as long as I know what it does the specific word does not really matter.</li>
<li><strong>In Body</strong> is the standard default context for each row of data. </li>
</ul>
<p>With Desktop Intelligence we have the option of <strong>In CurrentPage</strong> which can be quite useful and unfortunately not yet available in Web Intelligence. I probably don&#8217;t have to explain how the &#8220;CurrentPage&#8221; total is derived. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally, these keywords can appear in several places in a formula. The most common are the &#8220;input&#8221; and &#8220;output&#8221; context settings, but certain functions (like <code>RunningSum()</code> for example) also have a &#8220;reset&#8221; context. </p>
<ul>
<li><strong>Input</strong> context is used to determine the input values for the formula.</li>
<li><strong>Output</strong> context is used to determine the output scope of the formula.</li>
<li><strong>Reset</strong> context is used to determine when a running function starts over at zero.</li>
</ul>
<p>Dimensions referenced in the input context do not have to appear in the block. Output and reset dimensions must appear in the block in order to function correctly. For many calculations the default input context works just fine. I will show an example where it&#8217;s crucial to understand input context later on. For now I would like to move on to a simple example.</p>
<h3>Simple Calculation Context Example</h3>
<p>It&#8217;s hard to fully grasp some of the subtleties of calculation context without good examples. For this post I will provide one simple but common example that I mentioned earlier: contribution percent. I will start with a simple block with one dimension (resort), one measure (revenue), and a grand total as shown here.</p>
<p><img src="/tips/calc_context_intro/simple_block.jpg" width="217" height="121" border="0" alt="simple report block" title="Web Intelligence simple report block with grand total" /></p>
<p>This block already has a total on it. If this were a typical spreadsheet I could reference the total value using a row/column address, but that doesn&#8217;t work in Web Intelligence. That means I have to use another technique to generate the grand total. I mentioned the solution earlier&#8230; all I have to do is create a simple formula that looks like this:</p>
<p><img src="/tips/calc_context_intro/formula.jpg" width="511" height="265" border="0" alt="calculation context formula" title="Web Intelligence variable editor with simple calculation context formula" /></p>
<p>Here&#8217;s the formula again:</p>
<p><code>=[Revenue] / [Revenue] In Report</code></p>
<p>Remember that the <strong>In Report</strong> context projects the measure up to the overall report total. By using that calculation context operator in the denominator of my division I ensure that I will always be dividing by the grand total in this formula. The results?</p>
<p><img src="/tips/calc_context_intro/finished_block.jpg" width="325" height="121" border="0" alt="Finished report block" title="Web Intelligence report with context for percent contribution calculation" /></p>
<h3>What&#8217;s Next?</h3>
<p>This post barely scratched the surface of the calculation context question. It provided a few brief definitions and one simple example. I have several other posts planned that will dive into much greater detail about this often confusing subject. First I plan to talk more about In versus ForEach versus ForAll and how they are different. Next I plan to cover input versus output context and when each should be used. As I write this post neither of those two are much more than an outline for now, so I don&#8217;t have an estimated publish date.</p>
<p>But they&#8217;ll get published. Eventually. <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/2010/01/04/calculation-context-part-i-overview/feed/</wfw:commentRss>
		<slash:comments>44</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>30</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>Constants, Formulas, and Variables, Oh My!</title>
		<link>http://www.dagira.com/2009/11/03/constants-formulas-and-variables-oh-my/</link>
		<comments>http://www.dagira.com/2009/11/03/constants-formulas-and-variables-oh-my/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 11:39:36 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[2009 GBN - Dallas]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Variables!]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=217</guid>
		<description><![CDATA[In the first post in this series I talked about different places I could place complex calculations. I reviewed some pros and cons of doing calculations during ETL, in the universe, or on a report. In this post I am going to focus only on report calculations. I will cover the formulas versus variables debate [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.dagira.com/2009/10/28/calculation-options/">first post in this series</a> I talked about different places I could place complex calculations. I reviewed some pros and cons of doing calculations during ETL, in the universe, or on a report. In this post I am going to focus only on report calculations. I will cover the formulas versus variables debate and show a couple of tricks to make working with variables a little bit easier along the way.</p>
<p><em>This presentation covers slides 10 through 12 from my 2009 GBN presentation titled &#8220;Return of the Variables&#8221; which can be downloaded from my <a href="http://www.dagira.com/conference-presentations/">conference page</a>.</em> <span id="more-217"></span></p>
<h3>Constant, Formula, or Variable?</h3>
<p>A constant is a value that is never going to change. Constants are probably quite rare, to be honest. I could hard-code a sales tax rate into my report but it is far more likely that the tax rate will come from the database. Same for commission percentage or project deadline dates or any other data along those lines. In any case, they&#8217;re not really complex and they&#8217;re certainly not calculations so I will move on. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>That leaves formulas and variables. How are they different? How are they the same?</p>
<p>Both can use the full range of report engine functions. Both can be used just about anywhere on the report. Is there any reason to select one technique over the other?</p>
<p>Yes, yes there is.</p>
<h3>The Four Cs</h3>
<p>Years ago when I wrote my first Variables presentation I came up with what I called &#8220;The Four Cs&#8221; to describe why variables are better than formulas. They are:</p>
<ul>
<li><strong>Convenience</strong><br />
A variable can be used with every report feature. I can&#8217;t build an Alerter using a formula, as shown here:</p>
<p><img src="/tips/why_variables/alerter.png" width="341" height="231" border="2" alt="alerter screen" title="Variables are required for alerters; formulas do not work" /></p>
<p>I can&#8217;t rank on a formula. In Web Intelligence I get a list of query objects and a list of variables, but not formulas. The list probably goes on from there but that&#8217;s probably enough important features to prove the point. Variables can be used in places where formulas cannot be used.</li>
<li><strong>Clarity</strong><br />
Simply put, a variable is a formula with a name. A name defines the purpose of the calculation. It is much easier to understand a complex calculation like this:</p>
<p><code>=((100-[Discount Rate])/100)*[List Price]*[Qty Sold]</code></p>
<p>&#8230; when that formula is also named &#8220;Sale Value After Discount&#8221; and saved as a variable.</li>
<li><strong>Complexity</strong><br />
Sometimes it&#8217;s hard to figure out the syntax for a complex calculation. I will often break something down into simple steps and store the results as variables. Because variables can be reused (formulas cannot since they don&#8217;t have a name and therefore cannot be referenced) I can check my work at various points and make sure I am seeing the expected results. In another post related to this conference presentation I showed an alternative way to <a href="http://www.dagira.com/2009/10/23/calculating-business-days-between-two-days-via-report-functions/">calculate the number of business days between two dates</a>. If you review that post you will see that the formulas get quite complex indeed! <img src='http://www.dagira.com/wp-includes/images/smilies/icon_eek.gif' alt=':shock:' class='wp-smiley' />  You can bet that I didn&#8217;t come up with the final version without working carefully through each step. Using variables, of course.</li>
<li><strong>Consistency</strong><br />
Once a variable is built it appears on the list of report &#8220;components&#8221; saved as part of the document. I have touched on this aspect of variables already in this post. Because variables appear on this list they are reusable throughout the report. Because I can reuse them throughout the report I can edit them in one place and have the changes propagate everywhere I use that particular calculation. If I spend the time and effort to create and test a complex calculation, it&#8217;s nice to know that it is reusable and will therefore provide consistent results throughout my document.</li>
</ul>
<h3>Wish List: Universe (or Universal) Variable Repository</h3>
<p>At one point I had started writing a VBA script that would allow me to create report variables and check them into a &#8220;variable repository&#8221; that I stored in a Microsoft Access database. The idea was that once a variable was created I could then easily reuse it in other documents. This worked fine for desktop documents. Web Intelligence documents were not supported at all since the utility was based on VBA. It would be nice if we could see this feature supported directly in the universe framework.</p>
<h3>Building Variables</h3>
<p>Building variables in a document is fairly simple. I can click the proper button on the toolbar (shown below). </p>
<p><img src="/tips/why_variables/create_variable.png" width="475" height="286" border="2" alt="invoke variable editor" title="Invoking the variable editor via a toolbar button" /></p>
<p>After clicking this button I am presented with the following screen that allows me to create my local calculation. (Note: this screen is from XI 3.0 and is different from what you will see in prior versions.)</p>
<p><img src="/tips/why_variables/variable_editor.png" width="550" height="483" border="0" alt="variable editor" title="Creating a variable in a Web Intelligence report" /></p>
<p>This screen allows me to enter a name for my variable, set the qualification (dimension, detail, or measure), and access the full range of report functions.</p>
<p>There is another way that I can create a calculation; I can use the formula bar much like I can in a spreadsheet. Here I have activated the formula bar using the appropriate button and have clicked inside the edit area and started to create my formula.</p>
<p><img src="/tips/why_variables/formula_bar.png" width="592" height="200" border="2" alt="formula bar" title="Creating a formula with the formula bar in Web Intelligence" /></p>
<p>Is this a problem?</p>
<h3>Formula Challenges</h3>
<p>For this demonstration I have created the following simple formula.</p>
<p><code>=[Revenue] / 100</code></p>
<p>I can use this formula in a report block. In fact I can copy it to multiple report blocks. The problem is, after I have done this I have three (or more) different copies of the same formula. If I click on the initial cell where I created the formula and edit it (perhaps I meant to type 1000 instead of 100 earlier) then <strong>only that instance of the formula is changed</strong>. The rest of the formulas are stored elsewhere in the document and are not affected by the edit.</p>
<p>This is a problem.</p>
<h3>Converting a Formula to a Variable</h3>
<p>If I made this mistake and want to convert my wayward formula into a variable I can do that. There is a button on the formula toolbar here:</p>
<p><img src="/tips/why_variables/convert_to_variable.png" width="455" height="95" border="2" alt="toolbar button" title="Toolbar button to convert a formula to a variable in Web Intelligence" /></p>
<p>When I click that button I am presented with the following dialog box that allows me to assign a name to my formula. </p>
<p><img src="/tips/why_variables/name_variable.png" width="437" height="284" border="0" alt="Naming a variable" title="Naming a variable" /></p>
<p>Once a formula has a name it becomes a variable and shows up in the document data tab.</p>
<p><img src="/tips/why_variables/data_tab.png" width="209" height="198" border="2" alt="Data tab" title="Variables and objects in the data tab of a Web Intelligence report" /></p>
<h3>Summary</h3>
<p>This part of the presentation was probably considered to be fairly basic by most (if not all) of the folks in the room. However, I always repeat this same information every time I deliver a variables presentation. Why? Because of what happened years ago when I presented &#8220;Variables and More… Fourth Edition&#8221; at the conference in Las Vegas. I thought that by then everyone knew about the toolbar button that provided a way to convert a formula into a variable but it seems that was not the case. The very last question that I took from the audience was from a woman who wanted to know what to do with a formula she had created by mistake. I quickly created a formula and then showed how to convert it into a variable using the process I outlined here. I then found out just how many folks didn&#8217;t know about this technique, as it seemed the entire audience went &#8220;oooh, aaaah&#8221; and proceeded to give me the highest rated presentation marks that I have ever received. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </p>
<p>It just goes to show that anything and everything that you know is probably worth sharing. It is very likely that there is somebody, somewhere that doesn&#8217;t know what you consider to be basic information. Share those simple tricks and they are much better off. Plus you earn some good karma. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So go ahead, answer a few questions on <a href="http://busobj.forumtopics.com">BOB</a>. Start a blog. Share what you know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/11/03/constants-formulas-and-variables-oh-my/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Calculation Options</title>
		<link>http://www.dagira.com/2009/10/28/calculation-options/</link>
		<comments>http://www.dagira.com/2009/10/28/calculation-options/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 11:00:21 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[2009 GBN - Dallas]]></category>
		<category><![CDATA[Report Techniques]]></category>
		<category><![CDATA[Universe Design]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=216</guid>
		<description><![CDATA[When working with the reporting suite from Business Objects there are many different calculation engines. A report developer can create custom formulas or variables in Desktop Intelligence, Web Intelligence, and of course Crystal. A universe designer can build custom objects using database functions in the universe. An ETL architect can design special query transformations. So [...]]]></description>
			<content:encoded><![CDATA[<p>When working with the reporting suite from Business Objects there are many different calculation engines. A report developer can create custom formulas or variables in Desktop Intelligence, Web Intelligence, and of course Crystal. A universe designer can build custom objects using database functions in the universe. An ETL architect can design special query transformations. So where do you do the work?</p>
<p><em>This post covers slides 6 through 9 from my 2009 GBN presentation titled &#8220;Return of the Variables&#8221; which can be downloaded from my <a href="http://www.dagira.com/conference-presentations/">conference page</a>.</em> <span id="more-216"></span></p>
<h3>Push it Back, Push it Back, Way Back!</h3>
<p>I can&#8217;t help but hear some football cheerleaders calling out inspirational words to their team as I write that heading. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' />  But the reality is that the concept is quite appropriate for this discussion. There are quite a few advantages to putting calculation logic into your ETL (extract / transform / load) tool. For example&#8230;</p>
<ul>
<li><strong>Build on core data</strong><br />
ETL tools or other scripts working on core data have an advantage&#8230; they&#8217;re working on the core data. (That&#8217;s almost a recursive definition, which is another presentation. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) What I mean by that is there isn&#8217;t anything getting in the way between the process and the data. My scripts can do whatever they want because everything they need should be available. If it&#8217;s not immediately available I can build it in a temporary table and move on from there. ETL tools are very powerful in this regard.</li>
<li><strong>Procedural languages / scripts</strong><br />
Even in a simple ETL environment where no formal tool is being used I can still write procedural scripts. I can write procedural SQL (PL/SQL) or even C scripts. The only limits are my imagination and the grammar of the selected tool.</li>
<li><strong>Consistency across all access paths</strong><br />
This is a real key advantage of pushing calculations back to the ETL layer. Since this process is generally responsible for filling your data warehouse tables, and the calculations are done during that load, it means that any tool used to access that database inherits the results. It means I can use any query tool and still gain the benefits of the calculation results.</li>
<li><strong>Calculate and store once, retrieve many times</strong><br />
This is my primary differentiator between putting a calculation in the universe versus doing it in the ETL. I was recently given a block of code and asked to create a predefined condition in the universe to handle the logic. The problem was it was extremely complex and included a number of case statements and outer join requirements&#8230; and it was going to impact the fact table. I pushed back and requested that the logic be placed into the ETL. The end result was I got a simple Boolean flag (zero or one value) on the fact table that was much easier to use. An added benefit? If the logic required to populate that field ever changed it could easily be done in the ETL.</li>
</ul>
<p>Unfortunately there are other issues to consider before putting a calculation into the ETL.</p>
<ul>
<li><strong>Change Management</strong><br />
Not all of the aspects of doing calculations in the ETL are good. For example, most companies seem to have far stricter controls and change management processes around their ETL than they do for reports. Getting a change pushed through the ETL team can have a far wider impact and therefore can take longer and require more justification. Sometimes it is easier to keep a calculation closer to the report to avoid development delays.</li>
<li><strong>Complexity</strong><br />
ETL scripts can already be quite complex. Adding new calculations might slow the scripts down and cause them to run beyond their available load window.</li>
<li><strong>Impact Analysis</strong><br />
One of the primary advantages of including calculations in the ETL is that the results are shared by everyone. One of the disadvantages of including calculations in the ETL is that a change in that area will impact everyone as well. That means more teams to talk to in order to get a consensus that the change is appropriate and approval to start the process.</li>
</ul>
<p>In my opinion, despite the potential for slower turn-around time on development requests and the need for greater impact analysis, complex calculations should be pushed back to the ETL if at all possible. This is especially true if the calculations impact join logic, affects security profiles, or needs to be performed on the fact where it will impact nearly every single query that is executed.</p>
<h3>Using Universe Objects</h3>
<p>The next possible location for calculations is the universe. There are quite a few advantages to putting something into the universe as opposed to having it done in the report. Such as&#8230;</p>
<ul>
<li><strong>Build once &#8211; use many times</strong><br />
Universe objects are designed to be reusable. Once an object is built it can be used / reused in any number of reports. This is one of the primary reasons we even build universes (that and providing the abstraction layer so business users don&#8217;t need to know technical terms.)</li>
<li><strong>Use full range of database functions</strong><br />
There is a wide range of functions available inside each of the different report engines, but you can&#8217;t access the power of the database. I can use almost any function available from my database to build an object. And if there isn&#8217;t a function available to do what I want, I can build one. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><strong>Ensure consistency from report to report</strong><br />
For quite a long time Business Objects used the slogan &#8220;Single version of the truth&#8221; when talking about their products. This was based on the concept of reusable objects that I already covered above. Since every business user will be using the same object for Sales Revenue, they should all get the same result when they ask the same question.</li>
<li><strong>Updates automatically propagate</strong><br />
Reports built on a universe will automatically get updates when they are published. This means if I discover a bug in one of my objects and fix it, every report that uses that object will get the updated code the next time the report is refreshed. This was a big advantage of the &#8220;classic&#8221; Business Objects tools over Crystal reports for many years. Any tool that requires a developer to manually write their own SQL code is subject to the same limitation.</li>
</ul>
<p>That&#8217;s a nice list of advantages for universe objects. What about the disadvantages?</p>
<ul>
<li><strong>Limited to information from a single universe</strong><br />
Universe calculations cannot combine objects from two different universes. In fact it&#8217;s worse than that; you can&#8217;t combine objects from two different contexts in the same universe! <img src='http://www.dagira.com/wp-includes/images/smilies/icon_eek.gif' alt=':shock:' class='wp-smiley' />  This can be a very limiting factor depending on how complex your universe models are.</li>
<li><strong>Maintenance required by universe designer</strong><br />
Getting universe work done should be less traumatic than changing the ETL, but it can still be a roadblock depending on the availability of your developer. Notice I said &#8220;developer&#8221; as it is very difficult to manage a process where more than one person works on the same universe at the same time.</li>
<li><strong>Some aggregation issues can be tricky</strong><br />
Percentages and ratios and average calculations are <a href="http://www.dagira.com/2009/05/15/why-cant-i-average-in-my-universe/">all difficult to do in a universe</a>. There is a new feature called &#8220;smart&#8221; or <a href="http://www.dagira.com/2008/11/10/designer-xi-3-new-feature-database-delegated-measures/">&#8220;database delegated&#8221; measures</a> that started in XI 3.0 that helps some but it&#8217;s still an issue to be considered.</li>
<li><strong>Some functionality might be missing from the database</strong><br />
It&#8217;s less likely today then when I wrote the very first Variables presentation back in 1997, but it might be that the functionality you want or need just isn&#8217;t available in your database. Rather than writing a custom database function it might be easier simply to create report calculations instead.</li>
</ul>
<h3>Report Structure Items</h3>
<p>There are three basic options available in the report engines provided by Web Intelligence (and Desktop Intelligence as well if you&#8217;re using that tool.) They include constants, formulas, and variables. I will talk more about these three choices in the next post. For now I would like to consider the pros and cons of this option.</p>
<ul>
<li><strong>Available on all platforms</strong><br />
As mentioned both Desktop Intelligence and Web Intelligence offer this feature. Crystal goes even further and provides a language that includes scripting features. A report writer can pick the appropriate tool for the job without worrying about losing a calculation engine.</li>
<li><strong>Independent of SQL restrictions</strong><br />
The grammar for local calculations comes from the report engine, not the SQL database. That means if you are using a database with limited functions (Sybase IQ comes to mind) you can still accomplish complex tasks in the report by using the available report functions instead. The first time I worked with Sybase IQ was years ago, and it didn&#8217;t even offer a way to retrieve the current system date from the host.</li>
<li><strong>Calculations based on document data</strong><br />
When you refresh a query you download a microcube into your report. The calculations are then done on that smaller summarized dataset rather than applied to the entire rowset processed during the query process. It could be a performance benefit to be able to do the calculations locally.</li>
</ul>
<p>That all sounds great, but there are disadvantages as well.</p>
<ul>
<li><strong>Stored in a single document</strong><br />
In the ETL and Universe section I talked about being able to reuse calculation results. I can do that with report variables too, but only in different reports (tabs) within the same document. If I want to use a complex formula in a new document I have to copy / paste or recreate from scratch.</li>
<li><strong>Require some level of technical expertise</strong><br />
Most report writers can build simple calculations, especially operations found on the toolbar buttons like sum and count. However, getting complex calculations correct can be a struggle even for seasoned developers. It took a long time for the concept of calculation context to &#8220;click&#8221; for me, and even today it can sometimes be a challenge.</li>
<li><strong>Volume of data could impact performance</strong><br />
Earlier I said that calculations at the report level might improve performance, and now I am saying that the volume could impact performance. Is this a contradiction? No, not really. What I said earlier was that if the report calculations are done on data already summarized by the database engine they should be fast. If the data is not summarized, meaning if the microcube present in the report has a large number of rows, then having additional calculations can certainly slow things down.</li>
</ul>
<h3>Summary</h3>
<p>Wow, that was a lot of text. It&#8217;s easier to say all of this stuff than to write it down. Can you all do me a favor and just come to the conference next time so I don&#8217;t have to write so much? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </p>
<p>In all seriousness, what I tried to do with these few slides in my presentation was to outline some of the general thoughts that go into deciding where to put a calculation. Is there a clear and obvious choice as to which to use? No, not really. I apologize if that&#8217;s what you were hoping for at this point. Each of these three areas (ETL, universe, report) has clear advantages. In general I prefer to push complex calculations as far back as possible. But if needed we have quite a few options available. </p>
<p>The next post in this series will focus on the different types of report calculations (specifically formulas and constants) and discuss which of those is better. In this case (unlike this post) there is a very clear choice. You can probably guess what it is&#8230; after all the presentation title was <em>Return of the Variables</em>. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2009/10/28/calculation-options/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

