BusinessObjects Board

display "ALL" instead of entire list if all are se

Hi, im building reports in WebIntelligence and I need to display the Parameters (UserResponse - Query Filters) in the header of each report.

when the report is run, the user is prompted and selects all the items in the list - I want to display “ALL” rather than all the items in the list (causing it to run off the page). How do I do this?

I just started using Business Objects, so I’m sorry to post what is probably a no-brainer. I do appreciate your help.


D J (BOB member since 2007-06-20)

Welcome to B :mrgreen: B

Always do a Search before opening new post to avoid topic fragmentation.
There is full possibility that the same issue has been already discussed.
Search Keywords: ALL and prompt

Have a look at this:

Cheers


haider :es: (BOB member since 2005-07-18)

Thanks for the help Haider! Actually, i did search the forums for those keywords and found the thread you provided te link for.

Unfortunately, since i have about one day of business objects experience and no instruction whatsoever, i dont even know how to create a predefined prompt condition or add a value not in the table to a LOV.

Thats why my needs (right now) are a little simpler. I don’t want to add “ALL” to the prompt. I simply want to display “ALL” on my report when all the entire LOV is selected in one of the prompts. I was hoping there would be a way to do create a new variable with variable editor and use an if statement to check the UserResponse to see if all items were selected and either display “ALL” or list the selected items.

Can anyone help with this?


D J (BOB member since 2007-06-20)

Try this. It works :slight_smile:

= If (UserResponse (“DP Name” , “Select Location(s) or type ALL:”)=“ALL”) Then (“Suppliers : ALL”) Else ("Suppliers : "&UserResponse (“DP Name” , “Select Location(s) or type ALL:”))

Cheers!!


myboforum (BOB member since 2007-05-15)

I can’t test anything right now, but check the ‘fag packet thinking’, below.

If you know what should be in the LOV and it is unlikely to change, then you could do what you suggested. The column of LOV values would have to exist as cloumn in your report for you to create the second variable, defined below.

You could test for the number of rows with a - non displayed, i.e. not a column in your report, variable using for example a running sum in your report, starting at row one.

Something like:

RunningSum(),1

Then call it row count

Then you would build a second variable in the report to test for the maximum number of known rows, displaying All, if all values of the LOV are going to be displayed or the values if the number has not exceeded that row count.

Something like

=If([row count]>50;'All';[LOV Value Object Name])

There a couple of ideas, but there is a better way of doing this, is a combination of Haiders and myboforums posts along with a few modifications.

Good Luck :mrgreen:


Mak 1 :uk: (BOB member since 2005-01-06)

Actually, no, it won’t work, because there is no “All” in the list of values. Y’all need to read the requirement a bit closer before responding. :wink:

The original question was this:

I have a LOV. The user selects every value in the LOV. Now as a UserResponse() result is going to be quite long, how can I replace it with the word “All” instead.

My response: you will first need to know how many responses are possible. If it is a static list, then you can examine the number of semi-colons in the user response function result and based your logic on that. If you do not know what the total number of possible selects might be, you’ll have to approximate. I show that at the end.

For this example I will use eFashion where I know that there are 13 stores. If the user selects all 13 stores from a prompt, I will display “All Stores”, otherwise I will display the list of actual stores selected. Here’s how I do that.

Step 1. Build the report with a prompt for Store Name. I used the prompt text Select Store(s):
Step 2. Build the following variable called Selected Stores

=UserResponse("Select Store(s):")

Now, if you put that cell onto the report you will get a list of stores selected by the user; note that each store is separated from the next with a semi-colon character. ;

Build this variable called Selected Store Count:

=Length([Selected Stores]) - Length(Replace([Selected Stores];";";"")) + 1

This is quite ingenious, and I got the idea from another BOB member at some point, but I don’t remember who was the first to post it. Basically what you do is take the length of the user response and substract the length of the user response with the semi-colons removed. That will give you the number of semi-colons that appear in the string. By adding +1 to the end, you get the number of stores that were selected.

Now, here is the final variable, called Store Prompt Header:

=if([Selected Store Count]=13;"All Stores";[Selected Stores])

The results of that variable will be “All Stores” when 13 stores are selected, or the list of stores in the event that less than all stores are selected. I have also used this to provide a threshold, where I might do something like this:

=if([Selected Store Count]>=10;"You selected " + [Selected Store Count] + " stores";[Selected Stores])

That would show up to 9 stores, otherwise it displays the phrase “You selected 10 stores” or whatever the number might be.

Disclaimer: This will only work if you do not have any semi-colons in your data.


Dave Rathbun :us: (BOB member since 2002-06-06)

It was late :sleeping: .

Very much liked the method there,though, Dave… :slight_smile:


Mak 1 :uk: (BOB member since 2005-01-06)

With all due respect to Dave’s suggestion which is quite informative.

IMHO this can be considered.
Assuming that DJ is unaware of this feature, if the user is going to select all the values and the same to be displayed in the report then using the ‘ALL’ in the filter condition. Though it requires universe access and modification for creating the below condition object.

Emp.Ename IN  @PROMPT('Enter Name or * for ALL','A','Scott Emp\Ename',MULTI,FREE)
OR 'ALL'  IN @PROMPT('Enter Name or * for ALL'','A','Scott Emp\Ename',MULTI,FREE)    

If user enters any name(s) or ALL in the prompt, the same will be displayed in the report accordingly.

Cheers


haider :es: (BOB member since 2005-07-18)

Just remember that this little OR statement can make things quite slow.

Also, the question asked was different. Dave’s answer is the only way to do this without doing what you suggest with the ‘ALL’. So, it depends on who has the control to make the universe change.


Steve Krandel :us: (BOB member since 2002-06-25)

wow, thanks for all the recent input!! After two weeks w/o an answer, I eventually went ahead and added “ALL” to my LOV and did it that way.

Nevertheless, now i have a few remaining issues.
what if i want to use “ALL” Dates? Is this possible?
if the user is prompted for a geography, can a following prompt display all the countries in that geography including the option of “ALL” for that geography?

My other issue is:

I appreciate all your help.


D J (BOB member since 2007-06-20)

You can’t use ALL for dates. You have to use some sort of Dummy date like 12/31/2999


Steve Krandel :us: (BOB member since 2002-06-25)

Check Steve’s reply as already suggested.

This topic discussed quite a number of times
Read these threads:


Cheers


haider :es: (BOB member since 2005-07-18)