Solved

Using Switch and IsNull commands together - Crystal XI

Posted on 2011-02-14
5
632 Views
Last Modified: 2012-05-11
I am using the Switch command with success untilllooking for the NULL.  See attachment.  The following 2 codes work but do not find  NULL and replace it with "Unknown".
switch ({C_BILLING.PatientType}like "E", "Emergency Room",
        {C_BILLING.PatientType}like "I", "Inpatient",
        {C_BILLING.PatientType}like "O", "Outpatient",
        {C_BILLING.PatientType}like ' ', "Unknown Account(s)")
OR
iif (IsNULL ({C_BILLING.PatientType}),"Unknown",
switch ({C_BILLING.PatientType}like "E", "Emergency Roomx",
        {C_BILLING.PatientType}like "I", "Inpatient",
        {C_BILLING.PatientType}like "O", "Outpatient"))

For testing,
I used:   iif (IsNULL ({C_BILLING.PatientType}),"Unknown", "xx")
It worked to return the "unknown".

What is wrong that will not allow either one of the first two codes to work?
Thank you....



Crystal-Help.jpg
0
Comment
Question by:rwarren99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 34890170
I don't know why those don't work

I would do it as

If IsNull({C_BILLING.PatientType}) then
    "Unknown"
Else
    Your Switch or if statements.

mlmcc
0
 

Author Comment

by:rwarren99
ID: 34891434
THAT WORKED ...
THANK YOU...

I am running XI 11.5.8.826
Any reason why my code would not work?
Thanks Again...
0
 

Author Closing Comment

by:rwarren99
ID: 34891452
Thank you for the assistance...
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34894041
As I stated, I don't know of a reason it doesn't.  It seems like it should but that may just be the way an iif works.

mlmcc
0
 

Author Comment

by:rwarren99
ID: 34895662
Thank you again for your assistance....
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question