cancel
Showing results for 
Search instead for 
Did you mean: 

User response() function in SAP WEBi

abhimanyu_sharma
Contributor
0 Kudos
11,803

Hi Experts,

I have created a Formula variable in Bex with name "Exchange Rate" which is ready for input and its type is Number.

when i Created Webi report over this, I get the prompt with Exchange rate.

Now, My requirement is to show the Total value = Stock  * unit cost * Exchange rate if user put some vaalue in Exchange rate prompt say 2.3.

If user doesn't put anything in Exchange rate Prompt(means left blank) then Total Value = Stock * unit Cost.

I used the userresponse function on the exchange rate but it wont work. I am getting #error in the column.

First i Create a variable with name Exchg Rate = userresponse("[Exchange rate]")

and then i created the variable Total value =If(IsNull([Exchg Rate])) Then Stock * unit Cost ELSE ( Stock  * unit cost * Exchange rate).

But i am not getting the desired results.

Please advise/help on this.

Thanks,

Abhimanyu Sharma

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Abhimanyu,

What Mr.Loic said seems correct and try to convert the userresponse value to number using tonumber() function. I had same requirement to display the date so I converted userresponse value to date using todate() function then it worked correctly.

LepreuxLoic
Advisor
Advisor
0 Kudos

Hi Abhimanyu,

Did you take into account function UserResponse() will return a type String ?

This means you cannnot use this function as a numeric value to calculate your Total Value.

You need first to convert this String to a Number with function ToNumber() and then multiply its result by your other Measure values.

Regards,

Loic

jyothirmayee_s
Active Contributor
0 Kudos

Hi,

Always use a technical name of the Bex prompt in Userrepsonse().

Also try this:

@ vExchange Rate:

=if (Userresponse("Technameofprompt") ="") then 0

Else

Userresponse("Technameofprompt")

@ vTotal Value:

=Stock  * unit cost * Exchange rate

Thanks,

Jothi

Former Member
0 Kudos

Hello Abhimanyu,

If you using BI 4.0 Webi then try to capture the user response from Predefined-functions..so that you can capture the values exactly.....

Please see below screenshot..

Regards,

Naveen D

sateesh_kumar1
Active Contributor
0 Kudos

Hi Abhimanyu

you should write =Userresponse("Exchange rate").

use this formula in blank cell to confirm it is pulling data.after this use the variable for calculation.