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

Format zero in chart to hyphen or null

Status
Not open for further replies.

timhans

Programmer
Jun 24, 2009
75
Hello, very new to Crystal Reports.

I have managed to write a conditional formula (it is my first and only took 15hrs to figure out).

Table name is 360 two of the fields in the table are "Relationship" and "Score"

Conditional_Client
If {'360_'.Relationsnhip}="Client" then {'360_'.Relationsnhip}

Then make Summery:

Field to Summarize: Conditional_Client
Calculate this Summary: Count

CntClient
If {'360_'.Relationsnhip}="Client" then Count ({@Conditional_Client}, {'360_'.Relationsnhip})

(The Bold is the Summary field)

Finally

Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then 0
else
{'360_'.Score}

I am using this in a bar chart, I need to format the chart such that when zero appears it is changed to a hyphen or the number zero is suppressed.

I have been trying but can not find the solution

Thanks
 
Here is what finally worked in a way that I could use in a chat.

Create a formula "Null" when the editor opens click close and save with out doing anything
then

Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then 0
else
{'360_'.Score}

Becomes
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then ToNumber{@Null}
else
{'360_'.Score}

This shows null when the condition is met, further I can add it to a chart and set it to "Show values:Avg of Conditional_Score"

then in a bar chart when the condition is met the associated bar is missing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top