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

Showing "0" or Null values in a bar chart

Status
Not open for further replies.

jack91

Technical User
Apr 13, 2009
185
US
Hi,

I have created a report for warranty of computers with the following Formula. When i use this formula to create a Pie chart I am NOT able to see the ones that have 0 or null values.

For example if there are NO computers that have warranty expiring within the next 30 days I *** still would like it to be shown in the bar chart. Un-fortunately I don't see it in the drop down list either.

example: 15 computers expiring and there is a label below which shows "Between 30 - 60 days".

Using Crystal version 10. Formula below:

if {column.warranty_end}>= currentdate and {v_asset1.warranty_end} <= currentdate+30 then
"Less than 30 days"
else ifcolumn.warranty_end} > currentdate+30 and {column.warranty_end}<= currentdate +60 then
"Between 30 - 60 days"
else if{column.warranty_end} > currentdate+60 and {column.warranty_end}<= currentdate +90 then
"Between 60 - 90 days"
else if{column.warranty_end} > currentdate+90 and{column.warranty_end}<= currentdate +365 then
"Between 90 days and 1 year"
else if{column.warranty_end} > currentdate+365 and {column.warranty_end}<= currentdate +730 then
"Between 1 - 2 years"
else if{column.warranty_end} > currentdate+730 then
"greater than 2 years"
else if isnull({column.warranty_end}) then
"no warranty"
else
"Warranty Expired"

Thanks very very much
Regards,
Jk
 
Tests for nulls have to go first, or the formula fails. Move that test to the start and you should get all the null values.

Don't ask me why Crystal does it like that - it surprised me too when I first encountered it.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
The formula works.

What I am saying however is:

In chart expert > on change of > order > Chart Sort Order > Named Group ----> in here when i click on the drop down list consider the following scenario:

These are the values in the formula

Less than 30 days
Between 30 - 60 days
Between 60 - 90 days
Between 90 days and 1 year
Between 1 - 2 years

Now if i click on the drop down list in the Chart sort order/Named group. If there are ** NO values in the data for say "between 1-2 years" -- the term does not even show up in the drop down list.

There seems to be no way to discard one of the 5 terms on the list if ALL of them don't show up.



Consider the formula to be only:

if {column.warranty_end}>= currentdate and {column.warranty_end}<= currentdate+30 then
"Less than 30 days"
else ifcolumn.warranty_end} > currentdate+30 and {column.warranty_end}<= currentdate +60 then
"Between 30 - 60 days"
else if{column.warranty_end} > currentdate+60 and {column.warranty_end}<= currentdate +90 then
"Between 60 - 90 days"
else if{column.warranty_end} > currentdate+90 and{column.warranty_end}<= currentdate +365 then
"Between 90 days and 1 year"
else if{column.warranty_end} > currentdate+365 and {column.warranty_end}<= currentdate +730 then
"Between 1 - 2 years"
else if{column.warranty_end} > currentdate+730 then
"greater than 2 years"

Is there any way to get around this issue in Crystal v10?

Thanks
Jk
 
If the data doesn't exist, you can't chart it. If you can initially expand your record selection criteria so that you have all groups represented, you could do a specified sort using all groups and then later when you run a more restricted dataset, I think the specified order would still be maintained--if that is primarily your issue.

-LB
 
HI LB,

How would i do a "specified sorting" using all groups?

"--specified sort using all groups and then later when you run a more restricted dataset, I think the specified order would still be maintained--if that is primarily your issue"

Thanks
Jk
 
As I said, you need to run the report using criteria broad enough that all groups will be represented--this might be by expanding the date criteria for example. Specified order is an option for sort order in the group expert or chart expert (highlight the on change of field->order->specified order).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top