cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Sum value to text

former_member406941
Participant
0 Kudos

Hello!

Trying to convert a sum value to appear as text.

Here is my formula:

if Sum ({@Thurs Daily Count})=0 then 0 else

Sum ({@Thurs Daily Count},{PTS_1_18_13_10_09.Scheduler}) / Sum ({@Thurs Daily Count})*100


I want to have this appear as "NA" instead of appearing as 0.  I believe I'll need to convert the number 0 to text "NA".....?  Thanks!


Rich

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Rich,

Change the code to:

if Sum ({@Thurs Daily Count}) = 0 then "N/A" else

totext(Sum ({@Thurs Daily Count},{PTS_1_18_13_10_09.Scheduler}) / Sum ({@Thurs Daily Count})*100)

-Abhilash

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

Try something like this:

if Sum ({@Thurs Daily Count})=0 then 'NA' else

ToText(Sum ({@Thurs Daily Count},{PTS_1_18_13_10_09.Scheduler}) % Sum ({@Thurs Daily Count}))

The '%' operator will automatically set the number as a percent so you don't have to explicitly use "*100" in your formula.

Note that both values in the If statement must be of the same data type.  If you want to tweak the format of output from the "else", look in the Crystal help for the ToText() function - there are a number of formatting options.

-Dell