Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Chart Filtering Post Reply Post New Topic
Author Message
AnthonyJ
Newbie
Newbie
Avatar

Joined: 20 Nov 2007
Location: United States
Online Status: Offline
Posts: 37
Quote AnthonyJ Replybullet Topic: Chart Filtering
    Posted: 20 Nov 2007 at 11:48am
Hi,
 
I am new to CR. I would like to filter records within a chart. Currently, there are 4 distinct data types in my chart. I am creating 4 charts each with its own data type. Can I create a filter on charts similar to WebI ?
 
Thanks.
XIR2 on Unix Solaris
CRXIR2, Oracle 9i/10g
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 21 Nov 2007 at 5:23am
The short is answer is no, you can't filter charts.

The longer answer is yes, you can filter charts.  But, it requires thinking about the entire solution a little differently.

Let's suppose you have four data types, typeA, typeB, typeC, and typeD.  Now, your report includes all four types, so you don't want to filter the report as a whole with Select criteria.  And, you've grouped the data based on some other field, so you can't just plop the reports in the group header.  How do you create a chart just for typeA?

Create a formula, like so:

If {MyDataType} = "typeA" Then 1 Else 0

Now, if you want a count of the records that are "typeA", you just sum up this formula, instead of doing a count.

Ah, but suppose you want to total up some other value for your "typeA" records.  Well, it's the same process:

If {MyDataType} = "typeA" Then {MyOtherValue} Else 0

I have used this method to do some fairly sophisticated data shaping for my charts (I produce metrics charts in Crystal as my job).  One interesting caveat, though, is that it does produce a lot of zero values.  These are often easy to filter out if you are using Top N or specified sort charts.  They are pretty much always going to fall into that "Other" category.  And, of course, a zero value is generally invisible on a chart.  But, it can have some unexpected data points show up in your legend.


IP IP Logged
AnthonyJ
Newbie
Newbie
Avatar

Joined: 20 Nov 2007
Location: United States
Online Status: Offline
Posts: 37
Quote AnthonyJ Replybullet Posted: 25 Nov 2007 at 3:00pm
Originally posted by Lugh

a zero value is generally invisible on a chart.  But, it can have some unexpected data points show up in your legend.
 
Thanks for responding to my question. I was able to filter the charts for each data type based on your logic. However, as you said, there are zero data points that show up in the chart. Is there a way to remove the zeroes or maybe change it's color to look invisible ?
XIR2 on Unix Solaris
CRXIR2, Oracle 9i/10g
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 26 Nov 2007 at 9:43am
Generally speaking, no.  You can't really do conditional formatting inside a chart.

I'm assuming you looked at the Top N and "specified order" options?

What kind of chart are you using?


IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.