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

Detail Variable Syntax - If A = "n" And B = "z" "True" 1

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good afternoon, I'm trying to create a Detail Variable that uses a Merged Dimension between two queries. If there is a commonality then it will display an A&E Attendance Number, from Query1. Logically I want to show the admission Ward if there is an A&E Attendance Number.

=If not(IsNull([A&E].[A&E Attendance Number]))And [Ward Name] InList ("CCU") Then "Medical"

I get the message "The object InList at position 50 is incompatible. (WIS 10076)

This is really frustrating.

Many thanks,
D€$
 
Hi,

I can't help you with syntax, but I can try help with general logic.

Is position 50 referring to the InList()? If so does the string CCU, somehow refer to a valid list? If I were doing this in Oracle SQL, the IN () list would be "'item1','item2'" and so on. So I might have a variable ...
[pre]
MyVar = "'item1','item2'"
[/pre]
...and my SQL might be
[pre]
IN (MyVar)
[/pre]
Just a thought.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
FYI: It appears that [Ward Name] is an incompatible object. If I remember correctly you can use a expression and make it a detail and I believe that will work.
 
Good morning guys. kray that totally worked, many thanks; I have created a detail variable called "MyWardName" =[Ward Name] and another detail variable called "A&E Admitted" =[A&E].[A&E Attendance Number] - this uses the merged dimension.

Hi Skip, I like your idea but I can't figure out exactly how to do that in BO as the only option appears to be "InList". I'm also struggling to get the following reduced with only one "AND" - if that's possible. Probably not, looking at it again.

=If Not(IsNull([A&E Admitted])) And [MyWardName] InList ("G3";"G4";"G5";"G8";"G9";"F2";"F7";"F8";"F9";"F10";"F12";"CCU";"HDU";"ITU") Then "3 - Medical" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("F5";"F6";"F5/SAU";"SAU") Then "4 - Surgical" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("F3";"F4") Then "5 - Trauma & Orthopaedics" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("F1") Then "6 – Paediatrics" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("Macmillan Unit") Then "7 – Oncology & Haematology" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("F11";"F14") Then "8 – Obs & Gynae" ElseIf Not(IsNull([A&E Admitted])) And [MyWardName] InList("Wedgewood House") Then "9 – Psychiatric" ElseIf Not(IsNull([A&E Admitted])) Then "999 – Unknown"

I have kept them all as "InList" just in case others are added to those that only currently have a single entry.

Oh, and I made the mistake of constructing this in Word but BO uses different quotation marks - of course it does - so I had to replace them all within the variable.

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top