Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Null Data Displayed On Chart Post Reply Post New Topic
Author Message
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Topic: Null Data Displayed On Chart
     Posted: 14 Dec 2011 at 4:25am
Hello,

I have a chart displaying average hours spent on work for several departments (TASKS.DEPT). The majority of the hours worked are by a NULL undefined apartment. The data for this department displays on the graph, which is fine. What I am trying to do is exclude a different department, let's call it Processing, from the chart.

So I put into the Select Expert the following:

{TASKS.DEPT} <> "Processing"

It does the job by taking the processing section out BUT it also removes the NULL department! Is there a way to remove Processing without the NULL department or would it be easier to convert the NULL department into a department with a value for TASKS.DEPT such as "Undefined"?
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 14 Dec 2011 at 5:03am
you could try to
in report options check the box "convert database NULL values to default"
IP IP Logged
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Posted: 14 Dec 2011 at 5:37am
Thanks, kostya. I've tried that and it caused all kinds of errors with other formulas I don't want to touch. Is there another way?
IP IP Logged
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Posted: 14 Dec 2011 at 5:45am
I ended up putting

IsNull({TASKS.DEPT}) or
{TASKS.DEPT} <> "Processing"

And it's giving me the results I'm looking for. For some reason it wasn't working right when I put the IsNull after the OR


Edited by little wing - 14 Dec 2011 at 10:09am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Dec 2011 at 7:28am
Yes, in crystal you always need to handle the NULL conditon first.
If you start with the other condition and it hits a null it stops evaluating on that condition and never gets to the OR.
Depending on your version you can , in the formula editor there is a toggle option to use either 'Exceptions for Nulls' or 'Default values for nulls' .
You can flip that to use the defualt values for only that formula versus teh overall report set up to use default values all the time.
IP IP Logged
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Posted: 14 Dec 2011 at 10:11am
Hmm, very interesting. I had read on here that Nulls are weird in CR, but that helps clarify things. Thanks for sharing your wisdom DBlank.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum