Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to use Sum which has value hyphen "-" Post Reply Post New Topic
Author Message
dax007
Newbie
Newbie


Joined: 17 May 2018
Online Status: Offline
Posts: 25
Quote dax007 Replybullet Topic: How to use Sum which has value hyphen "-"
    Posted: 14 Jun 2018 at 6:12am
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

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jun 2018 at 7:42am
is there a difference, for your data purposes, between 0 and null? or a SUM=0 vs. all NULL values for the group?
IP IP Logged
dax007
Newbie
Newbie


Joined: 17 May 2018
Online Status: Offline
Posts: 25
Quote dax007 Replybullet Posted: 14 Jun 2018 at 8:13am
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
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.016 seconds.