cancel
Showing results for 
Search instead for 
Did you mean: 

create variable from query filter

Former Member
0 Kudos

Hello;

I want to define @prompt parameters as dimension or measure. So that we will use those parameters for the calculations we will use in our reports.

For example; we will like to use prompt for year in efasion universe. This prompt is going to ask two year parameter (the operant we will use is between) We want to get the difference between these two years . and we will like to save that value as a different variable.

System: BusinessObjects XI 3.1

Thanks in advance.

Akar;

Edited by: Akar Selcik on Apr 22, 2011 12:07 PM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

You should use the UserResponse function in WebI to get the content of a prompt.

Hope this helps.

Regards,

Stratos

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Akar Selcik,

Yes, you can use userresponse() function like this below

=Abs(ToNumber(UserResponse("Enter Year(Start):"))-ToNumber(UserResponse("Enter Year(End):")))

Thanks

Dineshkumar

Former Member
0 Kudos

Hi Akar Selcik ,

I hope this below, can also work for your scenario, can you try this ,

=Abs(ToNumber(First([Year]))-ToNumber(Last([Year])))

similarly,

=Abs(ToNumber(Min([Year]))-ToNumber(Max([Year])))

Thanks

Dineshkumar

Former Member
0 Kudos

hi Dineshkumar89 ;

I checked the your formula . But variable when used alone returns correct results But it returns wrong value or error in same record.

for instance;

i created a variable named diff.year. formula = Abs(ToNumber(First([Year]))-ToNumber(Last([Year])))

selection value : First : 2001 Last: 2003

year Sales Revenue Diff.year

2001 39600 0

2001 3500 0

2003 6500 0

Results should be as below.

year Sales Revenue Diff.year

2001 39600 2

2001 3500 2

2003 6500 2

thanks.

Akar;

Former Member
0 Kudos

Hi Akar Selcik ,

Now this will solve your problem, the issue is about the calculation contexts,

check with this formula below, it will give you the result as per your requirement.

= Abs(ToNumber(First([Year]))-ToNumber(Last([Year]))) In Report

Use any of those formula but add a In Report Context in it,

Regards

Dineshkumar.