Skip to Content

Convert Sum value to text

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 30, 2014 at 05:36 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 30, 2014 at 05:36 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.