The Result Data Newsletter   
Volume 804 - April 2008   
© Copyright 2008 Result Data Consulting, Ltd.  614-505-0770  www.resultdata.com   

    Result Data Home Page  |  Newsletter Archive  |  Upcoming Events  |  Classes & Workshops  |  Request Information
Upcoming Events:  Mid Ohio BusinessObjects User Group: 5/20, Discover the Power of BusinessObjects XI 3.0:  5/20

Return to Newsletter Contents...

 

Customizing an LOV to include "All"

by: Joe Roberts, Principal Consultant, BECP, SLE, MCP

When someone asks me “can I create an ‘All’ option in a List of Values to use in my reports?” what they are really asking is “how can I avoid making the user select all of the values in a prompt if they don’t really want filter to a specific value in that prompt. Take for instance a report that prompts the user for a state but the user wants to see data for all states; he must select every state in the list and move them to the “selected items” list.  For example the prompt below asks the user to select a state, this user has selected not to filter by selecting all states (confusing…?  you bet!).

A more intuitive way to present that to the user would be by giving them an option to select “All States” or select an individual option as the example below shows.

Pic 2

Now isn’t that better? So how do we do that? I’m glad you asked.

1.)   First we must create a new dimension object in the universe.  We’ll call that object State_All. The purpose of this object is to return the word “All” for each State Name.  This object should be hidden in the universe since it will not ever be directly accessed as a dimension by end users. The select portion of this object will have to have a case statement to accomplish our intended results. That select statement should look like this:

CASE @SELECT(Customer\State)
WHEN @SELECT(Customer\State) THEN
     ‘** All States’
 ELSE
      @SELECT(Customer\State)

END

Note: the string constant returned says ** All States instead of just All States to force it to the top of the list in this particular instance.

2.)   Next we are going to modify the List of Values for the All_States object and add a second or combined query. We want this object to bring back the word ‘** All States’ but we also want it to actually bring back a list of states. To do that we must edit the List of Values and click on the Combined Queries button. This will add a second query joined to the first query as a union.

In the second query replace the State_All object with the original State object. The first query should look like this:

Pic 3

The second query should look like this:

Pic 4

Now view the SQL syntax and it should look something like this.

Pic 5

Click ‘OK’ twice to return to the properties tab of the State_All object. Before saving the object, make sure you check mark the “export with universe” check box or it won’t export your modified SQL.

3.)   Now all we have left to do is create a prompting filter object that uses our modified List of Values. For that I have created a new filter object called prompt for state. The filter object will use the @Prompt function and reference our new List of Values in our hidden class called State_All. The SQL for that filter object should look like this:

State.state In
@Prompt('Select A State or All States','A','Hidden Objects\State_All',multi,free)
OR ('** All States') IN
@Prompt('Select A State or All States','A','Hidden Objects\State_All',multi,free)

Now when the user runs any query against this universe and selects the “Select A State” condition they will see this instead:

Pic 6

That should make their selection process much easier and your life at least a little better. Happy analyzing and see you next time.

Go to Top  |  Return to Newsletter Contents

The Result Data Newsletter is published approximately once a month to share the latest information on business intelligence, data management and CRM. There should be a link below to allow you to change or remove yourself from our list. We take your requests very seriously. If you have any difficulty please contact us at 614-505-0770 and we will make sure that your request is handled properly. This is not intended to be an unsolicited message and you can reach us in person if needed.

© Copyright 2007 Result Data Consulting, Ltd. - All Rights Reserved
All trademarks and copyrights are the property of their respective owners. This information is provided without warranty.
Announcements
Save Big $$ On Gas This Spring
Schedule and attend any one of our qualifying public training classes from April through June 30th to receive up to $385 in gas cards OR  receive 10% off the normal class price.  Please contact our office for further details on promotion amounts and qualifying classes.   Restrictions apply and you must mention the promotional code Gas08 at the time of registration to receive the promotion.  Call 614-505-0770 for further details and restrictions.
Columbus Roadshow - Discover the power of BusinessObjects XI 3.0
See how you could put complete, trustworthy business intelligence into the hands of all of your people wherever their location.  This event will be held on May 20, 2008 at the Fawcett Center.  Call 614-505-0770 or click here for more information and to reserve your seat.
Mid Ohio BusinessObjects User Group
Join us for the Spring MOBOUG User Group meeting on May 20th. Call 614-505-0770 or click here for more information and to reserve your seat.
Looking for a Few Good Men and Women
Join our award winning team of Business Intelligence consultants and .Net Software developers.
Send your resume and salary requirements to:
jobs@resultdata.com