Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can i use prompt without equal the result to anything?? 2

Status
Not open for further replies.

fernanda

Programmer
Aug 8, 2002
11
PT
Hello!

Usually when I use the prompt function i use something like
&quot; <field> = @prompt(...)&quot;

But can i prompt the user a question and not equal it to anything...
Basically, what i would like to do os something like
&quot; @prompt(....)&quot; without the &quot;<field>&quot;

Thanks
 
If you want to use the prompt to remind the user to do something, then a short Visual Basic Program could be used to pop up a message, or even more simply the message could be in a cell in a report.

Business Objects uses the prompt in the creation of the SQL to interogate the database, to try and use the prompt for a simple message, would require you to cope with a blank response using an &quot;OR&quot; condition

e.g.

yourcondition = @prompt( - user hits return - giving blank response )
OR 1 = 1

This could provide you with an &quot;unused&quot; prompt but it is not an elegant solution
 
What i really wanted to do was something like:

In the beginning of the report ask the user a question. I don´t want to use <field> = @promtp(..) because i will filter the result obtained from the query. After i ask the question i want to keep the result and use it to calculate some measures, whenever i think it applies...

So, what i really need is not give the user a message ut make him answer a question and keep the answer not using this result to filter the query...

Thanks
 
Ok, so what you want is two Data Providers, one to return your unconstrained query, the other to pop up the prompt and store away the reply.

Take a look at this thread thread393-329795, the 8th block down shows how to create another data provider
 
PaulSGS, i never quite understood how to use two data providers or when to use them..

How can i apply that to my case..

Do you know any place where I can get information about data providers?
 
Data providers are not so scarey! Think of them in terms of two (or more) relational tables. If your data providers have fields in common, Bussiness Objects will automatically link them together.

As I said before, if you look at Thread393-329795, this gives you some more information.

In your case I presume you have one report you are happy with but want to enhance it with the prompt and you &quot;want to keep the result and use it to calculate some measures, whenever i think it applies...&quot;

So open this report (maybe a copy would be safer)

Now Click Data->New Data Provider
A dialog box pops up titled &quot;Insert New Data&quot; with choices.
Pick &quot;Build a new query on the universe currently in use&quot;
and carry on build a query.

Pick only one object, and put a condition in the bottom panel against the same object. REMEMBER THE PROMPT STRING

Run the query

Now Click Data->Variables->Add

In the Function Window
Select Data Provider function
Pick User Response
Fill in the Parameters (Data Provider Name) - displayed in left hand panel, and prompt string used

Change Tabs to Variable Editor->Definition Tab
Name the variable and probably best to define it as measure

This variable, built from your prompt is now available for use




 
I assume that you can create universe objects seeing as you talk about @prompt.

In that case you can do this without using two data providers. The way I do it is to create a new measure object which has the @prompt in it's select clause. To make it work the prompt has to be aggregated e.g. by using max(@Prompt(,,,,)). This tricks BO into popping up the prompt, but as it thinks it's a measure it does not affect the query.

Just include the object in you data provider, then to return the value the user enters use the UserResponse() function.

Hope this helps

Beck [wavey]
 
Hello rmitchell,

are you saying i should write somthing like &quot;max(@Prompt('Escolha o mês','N','Meses\Id do mês',Mono,constrained))&quot;.

BO doesn´t accept it: ORA-00903: invalid table name...

I´ve checked all relations and they are ok..

Is there any restriction to do this?'

Thxs

Fernanda
 
RMitchell,

and there is one more other thing...

Usually when i have a prompt dimension, i select something, and that is the column that appears in the report..

What will appear in this case?

Thanks again

Fernanda
 
I have done this a couple of times and maybe just stick to your basics. There really is no need to create an additional data provider. Just create a measure in the universe as follows:

@Prompt('Enter Weekly Spend','n',,mono,free)

Then you can use it within your report by retrieving the value as follows:

UserResponse(DataProvider(<Name>),”Enter Weekly Spend”)
Or
UserResponse(“Query Name”,”Enter Weekly Spend”)

I hope that this answers your question.

PS Take Care, ;:-D
 
Webi2002,

i managed to do that, but i had to put something in the where clause otherwise BO returned me the error &quot;Invalid table name&quot; (i don´t understand it).

I´m trying to make him choose a month between some specified in a certain filed table.
This is what i have in select clause
&quot;
@Prompt('Escolha um mês','N','Por Factura\Distinct dos meses v_agreements_det',Mono,constrained)
&quot;

This gives me the &quot;Invalid table error&quot; so i had to put
&quot;
TO_NUMBER(TO_CHAR(ICS_V_AGREEMENTS_DETAIL.DUE_DATE,'MM')) IN (1,2,3,4,5,6,7,8,9,10,11,12)
&quot;
in the where clause.


The thing is, when i drag this measure to my report, a weird number appears like (256 for example)... Where does this number come from? How does he reaches this value?
Do i have a way to not show anything when i ask him this question??

Thanks

Fernanda
 
Fernanda,

Stick to basics. I think I now understand what you are trying to accomplish, however you may find it simple if you just hardcode list of values within the prompt.

TO_NUMBER(@Prompt('Escolha um mês','A',{'1','2','3','4','5','6','7','8','9','10','11','12'},Mono,constrained))

You see the problem lies when you are trying to get a list of values from a table that may not be part of your context, or query from your desired result set. So if you are not going to have that then I suggest to use hard coding, however if you are using that as part of your result set, then I see no problem on using it referencing a table / context.

PS: Take Care, :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top