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

Formula For All Others = "Other" ??? 2

Status
Not open for further replies.

loveyoursite

Technical User
Apr 14, 2005
100
US
CRV10 - For this formula, could someone please tell me what to add if I want all other {PCODES.DESCRIPTION}'s to show as "Other". This formula does what I want it to do except anything not RN, LPN or CNA shows on the report as a blank instead of "Other". Thanks!

if {PCODES.DESCRIPTION} = "Registered Nurse" then "RN" else
if {PCODES.DESCRIPTION} = "Licensed Practical Nurse" then "LPN" else
if {PCODES.DESCRIPTION} = "Certified Nursing Assist" then "CNA" else
"Other
 
You may have NULLS to deal with.
try this:

Code:
If ( IsNull({PCODES.DESCRIPTION}) 
    or Trim({PCODES.DESCRIPTION}) = '' )
then "Other"
Else
if {PCODES.DESCRIPTION} = "Registered Nurse" then "RN" 
else
if {PCODES.DESCRIPTION} = "Licensed Practical Nurse" then "LPN" 
else 
if {PCODES.DESCRIPTION} = "Certified Nursing Assist" then "CNA" else
"Other"

Bob Suruncle
 
It may be a null issue, so try:

if isnull({PCODES.DESCRIPTION})
or
not({PCODES.DESCRIPTION} in ["Registered Nurse" ,"Licensed Practical Nurse", "Certified Nursing Assist"]) then
"Other"
else
if {PCODES.DESCRIPTION} = "Registered Nurse" then
"RN"
else
if {PCODES.DESCRIPTION} = "Licensed Practical Nurse" then
"LPN"
else
if {PCODES.DESCRIPTION} = "Certified Nursing Assist" then "CNA"

-k
 
Thank you both! That's exactly what it was. The field did contain other named certifications and it was blank if there were no certifications.

THANKS SO MUCH!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top