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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case query multi variables

Status
Not open for further replies.

Brenj68

MIS
Sep 22, 2011
21
0
0
GB
Hi, I'm using CR2008/ BO Universe XI

The situation is I need to calculate hour rates (defined) against individual resource grades, which are different whether India/ Rest of World on time spent on working on projects (actuals). I have something like this:

select if {@Country Convert} <> "India"
case "Grade 1" : "31.73"
case "Grade 2" : "42.75"
case "Grade 3" : "55.95"
case "Grade 4" : "78.99"
case "Grade 5" : "110.28"
case "Grade 6" : "140.51"
else if {@Country Convert} = "India"
case "Grade 1" : "25.76"
case "Grade 2.1" : "32.50"
case "Grade 2.2" : "32.50"
case "Grade 3.1" : "44.78"
case "Grade 3.2" : "44.78"
case "Grade 4" : "53.81"
else "0"

This should be obvious to me, but I've been looking at it too long now to see what I'm missing. All help appreciated. Thanks B
 
Not really sure what you are trying to do here.

If you are want to assign a value to variables then a simple formula located in the Group header (Grouped by country) will work.

But I am not sure what the else "0" is meant to achieve

Ian
 
Instead of 'else "0"', use:

default : 0

And remove the quotes from around the results after the colon so that you can use them in calculations.

-LB
 
Thanks guys for the input. Changed script to:

select if {@Country Convert} <> "India"
case "Grade 1" : 31.73
case "Grade 2" : 42.75
case "Grade 3" : 55.95
case "Grade 4" : 78.99
case "Grade 5" : 110.28
case "Grade 6" : 140.51
else if {@Country Convert} = India
case "Grade 1" : 25.76
case "Grade 2.1" : 32.50
case "Grade 2.2" : 32.50
case "Grade 3.1" : 44.78
case "Grade 3.2" : 44.78
default :0

but am seeing a 'then' keyword is missing. The reason for this approach, i suppose, is that there will be different hour rates across a broad range of countries and I need to manage this in the report until the system being reporting from is properly used and this information will be derived from it and I won't have to go through this approach.

Cheers
 
Sorry, I didn't notice your syntax. Also, you haven't shown what the field is that returns "Grade 1, Grade 2" etc., so I'll call it {table.grade}:

if {@Country Convert} <> "India" then
(
select {table.grade}
case "Grade 1" : 31.73
case "Grade 2" : 42.75
case "Grade 3" : 55.95
case "Grade 4" : 78.99
case "Grade 5" : 110.28
case "Grade 6" : 140.51
default : 0
) else
if {@Country Convert} = India then
(
select {table.grade}
case "Grade 1" : 25.76
case "Grade 2.1" : 32.50
case "Grade 2.2" : 32.50
case "Grade 3.1" : 44.78
case "Grade 3.2" : 44.78
default : 0
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top