How to use Sum which has value hyphen "-"

Printed From: Crystal Reports Book — Forum Name: Technical Questions

Hello,
I'm using following to display play hyphen "-" if the value is NULL

If isnull {Command} then
'   -'
else
ToText ({command} ,1)

This works just fine,but I want to sum of that group and if the group has only one row which is null then that that value display blank instead I want it that as hyphen "-"
For example:

AAA
A111      -
Total AAA
BBB
B111      -
B112      10
Total BBB 10

As you can see from above example "Total AAA" show just blank instead I want it to display - (Hyphen)

Any suggestion?

Thank you

is there a difference, for your data purposes, between 0 and null? or a SUM=0 vs. all NULL values for the group?
Thanks for your reply. That's the requirement, users wanted to display "-" instead of "0" if it is NULL.
But when I add up the values creates issue when it's "-"

Thanks again..


Also I tried some thing like

Leave the datatype for the column value to Number. Then setup a new formula to display hyphen if the value is null. Then for total use the following formula

If ISNULL ({RTotal0})

Then

' -'

Else

TOTEXT ({RTotal0},1)

When I validate it does not give me any error but when It "Save and Close" it gives me following message.

"A Number, Currentcy ammount, data, time, or date-time is required here."

Any help? Thanks..

Edited by dax007 - 14 Jun 2018 at 10:49am