<?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; Prompts</title>
	<atom:link href="http://www.dagira.com/category/design/prompts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagira.com</link>
	<description>...you are in a twisty maze of passageways, all different...</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:13:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>blogmaster@dagira.com ()</managingEditor>
		<webMaster>blogmaster@dagira.com()</webMaster>
		<category></category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>...you are in a twisty maze of passageways, all different...</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>blogmaster@dagira.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.dagira.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.dagira.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>Dave's Adventures in Business Intelligence</title>
			<link>http://www.dagira.com</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Designer XI 3 New Feature: Extended Prompt Syntax</title>
		<link>http://www.dagira.com/2008/11/01/designer-xi-3-new-feature-extended-prompt-syntax/</link>
		<comments>http://www.dagira.com/2008/11/01/designer-xi-3-new-feature-extended-prompt-syntax/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 12:44:36 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[2008 GBN - Dallas]]></category>
		<category><![CDATA[Prompts]]></category>
		<category><![CDATA[Universe Design]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=126</guid>
		<description><![CDATA[The @Prompt() function has been around for a very long time. There have been subtle changes made to it over the years to support some of the new Web Intelligence extended options but they were not always documented. I don&#8217;t know about you, but I find using undocumented features a bit daunting.  

Documentation is [...]]]></description>
			<content:encoded><![CDATA[<p>The @Prompt() function has been around for a very long time. There have been subtle changes made to it over the years to support some of the new Web Intelligence extended options but they were not always documented. I don&#8217;t know about you, but I find using undocumented features a bit daunting. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-126"></span><br />
<h3>Documentation is Good</h3>
<p>Designer 3.0 is the first time that I have been able to find the extended prompt syntax documented. It even mentions the <code>primary_key</code> attribute which was apparently present (and usable) in XI R2. This feature allows me to create prompts in the Universe Designer that will still <a href="http://www.dagira.com/2007/10/26/index-awareness-part-i-the-basics/">leverage Index Awareness</a>, assuming I have set that up.</p>
<p>Here is the prompt syntax shown in the XI 3 Designer manual:</p>
<blockquote><p>@Prompt(&#8217;message&#8217;,'type&#8217;,[lov],mono/multi,free/constrained/primary_key,per<br />
sistent/not_persistent, [{'default value':'default key'[,'default value':'default<br />
key',...]})</p></blockquote>
<p>I&#8217;ve <a href="http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/">covered the prompt syntax before</a> so I won&#8217;t review everything. But the new features are interesting. The new feature <code>primary_key</code> was used in my &#8220;Ninja&#8221; presentation from last year with a disclaimer about it being an &#8220;undocumented feature&#8221; and the note of being a bit risky to use as a result. Now it is not only documented but there is a modifier for the default value option as well.</p>
<h3>Using Index Aware Objects With Prompts</h3>
<p>Recall that index awareness is designed to create more efficient SQL. Instead of </p>
<p><code>RESORT.RESORT = 'Bahamas Beach'</code> </p>
<p>I would see </p>
<p><code>RESORT.RESORT_ID = 2</code></p>
<p>With the new prompt parameter I can specify the default value in a <code>value:key</code> pair, like this:</p>
<p><code>RESORT.RESORT_ID = @Prompt('Please select Resort', 'A', 'Resort\Resort', mono, primary_key, not_persistent,{'Bahamas Beach':'2'})</code></p>
<p>The option <code>mono</code> of course means I will only select one value. That is not new. The option <code>primary_key</code> tells the SQL generator that this object is index aware, and that I want the key to be used rather than the value. The option <code>not_persistent</code> is used to tell the SQL generator that I don&#8217;t want to retain the last user selected value. And finally, the string <code>'Bahamas Beach':'2'</code> is used to show that the default value shown to the user is Bahamas Beach but the default value provided to the prompt is the key value 2 instead. </p>
<p>Special note: if I want to use a default value, then I have to specify not_persistent. If I don&#8217;t, then the default value is only good the first time the query is refreshed. From that point forward the last user selection will be used instead.</p>
<h3>What About Those {}?</h3>
<p>A reader with extremely good attention to detail will notice that the syntax I posted above does not match what was shown in the user manual. In order to get the object to parse I had to follow the exact syntax shown in the function help in Designer rather than what is in the documentation. What&#8217;s different? The code I used has curly braces { } around the value:key pair at the end. The curly braces are also used when providing a hard-coded list of values, so I guess that&#8217;s not too surprising.</p>
<h3>Conclusion</h3>
<p>The primary_key and default:key additions to the @prompt() syntax are quite powerful, and should be well-received by universe designers. I feel much more comfortable using something that is documented (even with slight errors) than using a feature that isn&#8217;t detailed in the documentation or help files anywhere. The concept of index awareness just became a lot more attractive with this addition.</p>
<p><em>This feature was one of several mentioned in my Designer Essentials presentation delivered at the 2008 GBN conference. This feature was covered on page 9.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2008/11/01/designer-xi-3-new-feature-extended-prompt-syntax/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Using a &#8220;Magic Date&#8221; Value in Prompts</title>
		<link>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/</link>
		<comments>http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 12:21:45 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Prompts]]></category>
		<category><![CDATA[Universe Design]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=98</guid>
		<description><![CDATA[In the first post on designing universe prompts I talked about the idea of having a default date value present in a prompt. In case you don&#8217;t want to read the entire post, here is the executive summary:
You can&#8217;t do it, sorry.
At the end of that post I mentioned something called a &#8220;magic date&#8221; that [...]]]></description>
			<content:encoded><![CDATA[<p>In the first post on designing universe prompts I talked about the idea of having a default date value present in a prompt. In case you don&#8217;t want to read <a href="http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/">the entire post</a>, here is the executive summary:</p>
<blockquote><p>You can&#8217;t do it, sorry.</p></blockquote>
<p>At the end of that post I mentioned something called a &#8220;magic date&#8221; that I frequently use in my universes to get past this limitation. That&#8217;s my subject for today.</p>
<h3>Problem Definition</h3>
<p>I have a date prompt in my universe. I would like to be able to provide a default value of today&#8217;s date. This would allow my users to click-n-go on the report without having to update the date value each time. It is also essential for scheduled reports, which is something I didn&#8217;t really touch on last time. When I schedule a report, I have to provide values for every prompt. I have a long <a href="http://www.dagira.com/category/design/dynamic-dates/">series of posts on how to create some dynamic date objects</a> that can be used for scheduling, but those were not prompts.</p>
<p>In a nutshell: I need a way to accept a prompt value and convert it to today&#8217;s date for user convenience and for scheduling. Can I make that happen?</p>
<p><span id="more-98"></span><br />
<h3>Defining the Magic Date</h3>
<p>First, a quick recap. When I set up a prompt in the universe, one of the required arguments is the datatype. A &#8216;D&#8217; designates a prompt as a date value. That means that anything entered in that date prompt field has to pass the basic validation that will be done by the application. I can&#8217;t put the word &#8220;Today&#8221; in this prompt, as &#8220;Today&#8221; is not anywhere close to being a valid date. That&#8217;s where the concept of a &#8220;magic date&#8221; comes from.</p>
<p>What I do is define a specific date as the magic date. Quite frequently I will use something like January 1, 1900, as it is highly unlikely that any of my records will include that date as a valid entry. That is the first important point about this concept: I must pick a date that will never appear as part of my normal data. That&#8217;s my magic date.</p>
<h3>Defining the Prompt</h3>
<p>Once I have selected my magic date I can now create my prompt using the basic five parameters. It might look something like this:</p>
<p><code>@prompt('Enter shipping date','D',,mono,free)</code></p>
<p>In this prompt I am asking for a shipping date, I am expecting a valid date value, there is no list of values, and the user will enter only one value. There&#8217;s nothing magical about that prompt. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The magic comes in when I create the condition object that includes that prompt. Imagine that I have a report that is designed to show orders that shipped today. Suppose that my magic date is January 1, 1900, as I mentioned before. Here&#8217;s what the code looks like (I will explain it after):</p>
<p><code>orders.ship_date = case when @prompt('Enter shipping date','D',,mono,free) = '1900-01-01' then DATE else @prompt('Enter shipping date','D',,mono,free) end</code></p>
<p>I&#8217;ve used Teradata syntax here but the concept applies to any database. (Teradata offers several options to return the date for &#8220;today&#8221; and DATE is the example I selected here.) One of two things will happen in this condition. A user will either enter a standard date, or they will enter the magic date. If they enter a standard date the code resolves to this:</p>
<p><code>orders.ship_date = case when '2008-07-21' = '1900-01-01' then DATE else '2008-07-21' end</code></p>
<p>In this case the case logic eliminates the first option and takes the second option and the net logic becomes:</p>
<p><code>orders.ship_date = '2008-07-21'</code></p>
<p>What if the user enters the magic date? Using the same process the code first resolves to this:</p>
<p><code>orders.ship_date = case when '1900-01-01' = '1900-01-01' then DATE else '1900-01-01' end</code></p>
<p>Which is logically the same as this:</p>
<p><code>orders.ship_date = DATE</code></p>
<p>So, there I have it. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  By applying a case statement to the right-hand side of this database condition, I can react in two different ways. In one case I take the user parameter value exactly as entered. In the other case I convert a special date (magic date) into the system current date instead. Now if one of my users schedules a report with this prompt, all they have to do is enter 1900-01-01 as their date parameter and each time their scheduled report is executed the parameter value will change.</p>
<h3>Conclusion</h3>
<p>With some creative date logic I can convert the magic date to today, yesterday, end of this week, end of last week, end of the month&#8230; just about anything else that I&#8217;ve already covered in my dynamic date series of posts. I can use the concept of a &#8220;magic number&#8221; for numeric prompts and a &#8220;magic string&#8221; for text prompts as well, although those are generally not used as frequently.</p>
<p>Would it be nice if I could use a variable in a prompt to avoid this sort of extra work? Sure, I think it would. I listed a bunch of different prompt enhancements that I have been looking for, in some cases for years, in my last post on prompts. One of those enhancements that I (and a gazillion other folks) would like to see is proper cascading prompts. I plan to have that as my next post on prompts. <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/2008/07/21/using-a-magic-date-value-in-prompts/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>How Can I Make &#8220;Today&#8221; My Default Prompt Value?</title>
		<link>http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/</link>
		<comments>http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 04:18:40 +0000</pubDate>
		<dc:creator>Dave Rathbun</dc:creator>
				<category><![CDATA[Prompts]]></category>
		<category><![CDATA[Universe Design]]></category>

		<guid isPermaLink="false">http://www.dagira.com/?p=97</guid>
		<description><![CDATA[I have seen this question come up frequently on BOB lately. And if the question keeps coming up, it becomes an easy idea for a blog post. That way, once I document a concept or a solution I have somewhere consistent to link to. The short answer to the question, unfortunately, is no. But let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen this question come up frequently on BOB lately. And if the question keeps coming up, it becomes an easy idea for a blog post. That way, once I document a concept or a solution I have somewhere consistent to link to. The short answer to the question, unfortunately, is no. But let&#8217;s investigate and explain a bit further than that, shall we?</p>
<p><span id="more-97"></span><br />
<h3>Problem Description</h3>
<p>I have a report. The report has a date prompt. I want the date prompt to have a default value (partially possible) and I want the default value to be &#8220;today&#8221; instead of a standard date. The question is quite reasonable, in my opinion. Prompt handling has been one of the weakest points of the Business Objects tools for a long, looonnng time. A prompt can be created on a report or in the universe. If the prompt is defined in the universe there is a standard syntax. So I will start with a brief review of that syntax and move on from there.</p>
<h3>@Prompt() Me One More Time&#8230;</h3>
<p>The standard prompt syntax has five arguments. The first two are generally considered required while the remaining three are optional. Here is the syntax:</p>
<pre>@prompt('Enter prompt text here','A',LOV Source,mono/multi,free/constrained)</pre>
<p>I&#8217;ll break down each of those five parameters next. First, the prompt text. The first argument is required and is the most obvious&#8230; it contains the text that the user will react to. It&#8217;s a good idea to let the user know what&#8217;s going on and to provide some clue as to how the prompt will operate. For example, if you are using a prompt in an equality test, you should inform the user that they can only select a single value. If you are using the prompt in a list, then let them know they can select one or more values.</p>
<p>The next argument has three options: A, N, or D. These match with the datatype expected from the prompt. The &#8216;A&#8217; represents alphanumeric data, and any data entered is accepted as it was entered. Using an &#8216;N&#8217; denotes a numeric prompt and only valid numeric values are accepted. Finally, a &#8216;D&#8217; represents a date prompt. With this type of prompt Webi will include a spiffy calendar that a user can use to select their entry. This is available even if the LOV has been turned off.</p>
<p>The third parameter is a reference to a potential list of values for the prompt. There are two possible options: either a hard-coded list, or an object from the universe. If I wanted to make a hard coded list with the values &#8220;Yes&#8221; and &#8220;No&#8221; on it here is the syntax:</p>
<pre>{'Yes','No'}</pre>
<p>The values are surrounded with curly braces { } and entered as a comma-separated list. Character data is in quotes. Simple enough, yes? no? <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>If I wanted to use an existing object in the universe for the list of values I would enter that choice without the curly braces and in the format <code>'Class Name\Object Name'</code> instead. One common designer mistake is attempting to use a table.column syntax here. The table.column is of course the eventual source for the list of values, but the LOV query is defined as part of an object definition. That&#8217;s why you enter an object here rather than a table column.</p>
<p>The last two parameters are optional, but even if you leave them out you have to include the commas for the prompt syntax. In other words, this is valid:</p>
<pre>@Prompt('Do you like BOB?','A',{'Yes','Yes, of course'},,)</pre>
<p>Even though the values are missing the commas remain. What do the values do if you include them? The fourth parameter allows you to specify whether the prompt is a multi-select option or not. The value <code>mono</code> (no quotes here) says the prompt is restricted to a single value. The value <code>multi</code> (again, no quotes) allows for multiple values to be selected. The fifth parameter determines whether the user can type the prompt response or if they are required to pick from the list of values. The value <code>free</code> does the former, and the value <code>constrained</code> requires the LOV selection. Here&#8217;s a hint: don&#8217;t make a prompt constrained without providing a valid list of values source. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>So those are the five basic arguments for the @Prompt() function. Most of you will have noticed that none of them have anything to do with providing a default value. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /> </p>
<h3>@Prompt() Extended Syntax for Web Intelligence</h3>
<p>We got some new prompt options starting with Web Intelligence 6.x. One of the options a report writer could use was whether or not the last prompt value entered was the default for the next report run or not. Another option was whether the prompt had a default value or not. And finally, report prompts could appear in a user-specified order rather than in alphabetical order as before. But all of these options were <strong>report specific</strong> and not supported in Universe Designer. </p>
<p>Here&#8217;s what the extended prompt syntax looks like:</p>
<p><code>@Prompt('Enter value(s) for Something:','A','Class\Something',Multi,Free,Persistent,{'Default Option'},User:0)</code></p>
<p>I&#8217;ve already covered the first five parameters so now I&#8217;ll detail the last three. The sixth parameter has the value <code>Persistent</code> or <code>Not_Persistent</code>. The default value is to retain the last value entered (Persistent). This is also the legacy behavior; previous versions of the reporting tools only worked in a persistent manner.</p>
<p>The seventh parameter has a syntax that looks a bit like the hard-coded LOV from earlier with the curly braces. This is where a default value for the prompt can be stored. And finally, the last parameter determines the order of the prompt, starting with zero (0) as the first prompt and incrementing from there.</p>
<p>To reiterate something I stated earlier: <strong>These are report options only.</strong> These parameters can be entered into a prompt object definition in the universe, but they are unlikely to parse because of the extended syntax. In order to test this syntax I would have to export my universe and test in a Web Intelligence query.</p>
<h3>What About That Default Value?</h3>
<p>Extended prompt parameter number six: a default value. That brings me back to the original subject for this post, doesn&#8217;t it? I wanted to have a value like &#8220;sysdate&#8221; or a formula of some kind like CurrentDate() plugged into that parameter. Unfortunately, it doesn&#8217;t work. Any value entered for that parameter is treated as data, and no formulas or calculations will be calculated. So anything like sysdate or getdate() or CurrentDate() is going to fail. </p>
<p>The next trick is to try to reference an object, and store the formula as the object definition instead. Unfortunately, again, it fails. The object name becomes the default value for the prompt which is generally not the intended result.</p>
<h3>Conclusion</h3>
<p>What it boils down to, as I see it, is this: you can&#8217;t do it. There is no way to create a prompt syntax that will substitute in a value like &#8220;today&#8217;s date&#8221; for a prompt default value. It would be nice, but it doesn&#8217;t work.</p>
<p>However, I do have a work-around that I&#8217;ve used for many years. I create a &#8220;magic date&#8221; and some creative logic within the prompt to do the substitution <strong>after</strong> the user has already responded to the prompt. That&#8217;s the subject for the next post in this series. Stay tuned for details. <img src='http://www.dagira.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<h3>Things I really REALLY wish prompts could do&#8230;</h3>
<ol>
<li>Set a default with a variable. It&#8217;s the subject of this post, need I say more?</li>
<li>Be optional! With XI 3.0 a report writer can create optional prompts now, but we still can&#8217;t do them in Designer. Boo.</li>
<li>Do cascading prompts effectively. This has been on my wish list for-EVER. I have another post about cascading prompts coming up soon so I&#8217;ll save the majority of my whining until then.</li>
<li>We have free and constrained, I want a third option: validated. This would be the best of both worlds. A user would be &#8220;free&#8221; to enter the value if they wanted to, but it would be validated against the LOV provided in the universe. Today I have to allow the user to shoot themself in the foot by typing the wrong value, or I have to force them to use the LOV.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
	</channel>
</rss>
