Skip to Content
author's profile photo Former Member
Former Member

Getting zero(0) value as a output of a formula while both fields have values.

Hi All Crystal experts,

I have a report which has 2 groups, one on month(post_date) and another one on month_number. Now I am showing some aggregate values like sum(invoice_total), sum(Cash_total), sum(Open Item) etc which are sorted and grouped by month(post_date) for each month.

I have one formula in my report that is:

if @invoice_total = 0 then 0 else (@Cash_total) / (@invoice_total). None of my fields shows zero value in result but output of this overall formula is coming zero in the report.

I did like this also,

if @Cash_total= 0 then 0 else (@Cash_total) / (@invoice_total). But output of this formula also shows zero. while both fields have values

Could anybody help me on this. How to resolve this issue?


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 29, 2014 at 12:57 PM

    where are the formulas located on the report.

    Most likely, the formula which is using the divide operator is getting evaluated before the @Cash_total and @invoice_total formulas.

    This can happen because of the sections where they are placed, for e.g the divide formula being placed in the Group Header whereas,@Cash and @Invoice formulas being used in Group Footer.

    Did you get a chance to test the output after putting the code

    Evaluateafter (@Cash_total);

    Evaluateafter(@invoice_total);

    in the formula where the division operation is written?

    Prathamesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 28, 2014 at 12:35 PM

    Hi Remi,

    Please attach the report with saved data if possibe.

    -Abhilash

    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.