Link to home
Start Free TrialLog in
Avatar of Carlo
CarloFlag for United States of America

asked on

Set Running total from Blank to Zero

I have a running total that shows blank if there are no no values for that month and I want to show the value of zero. So this is the scenario:
Summarize Sales for that month if no sales then set value zero.

Field To Summarize: Order_Tot then for type of Summary I chose Sum
Evaluate: Use Formula; from begin of month to end of month
Reset: On change of Group
Avatar of Mike McCracken
Mike McCracken

WHat are you grouping on?
If it is the date (month) then are there records for the month?

Try this

If (IsNull({YourNumberField}) then
    0
Else
   {YourNumberField}

Base the running total on that formula rather than YourNumberField

mlmcc
Avatar of Carlo

ASKER

I am grouping by state.
How are you getting the total by month?

mlmcc
Avatar of Carlo

ASKER

Field To Summarize: Order_Tot then for type of Summary I chose Sum
Evaluate: Use Formula; from begin of month to end of month
Reset: On change of Group

I am getting the totals by month by the second option above....EVALUATE:  I chose there to use formula. I am selecting From and Two month there as a formula inside the summarize options.

This is the formula:
{SYSOENT.ORDER_DATE} >= CDateTime (2012, 10, 1, 00, 00, 00) and
{SYSOENT.ORDER_DATE} <= CDateTime (2012, 10, 31, 00, 00, 00)
Are there records for the month?
Avatar of Carlo

ASKER

No sale records...so it shows nothing. I want to show zero instead of nothing.
Try this

Add a formula

If {SYSOENT.ORDER_DATE} >= CDateTime (2012, 10, 1, 00, 00, 00) and
{SYSOENT.ORDER_DATE} <= CDateTime (2012, 10, 31, 00, 00, 00)    then
    {YourAmountFIeld}
Else
    0

Use a summary function on the formula

Why do expect to see a 0 if there are no records?
There was nothing to add so there is nothing to show

mlmcc
Avatar of Carlo

ASKER

If there are no records than show a value of zero for that state for that month.

As per your formula this is how I have it.
I get no errors but still showing blank for that date range.

If {SYSOENT.ORDER_DATE} >= CDateTime (2012, 10, 1, 00, 00, 00) and
{SYSOENT.ORDER_DATE} <= CDateTime (2012, 10, 31, 00, 00, 00)    then
    {SYSOENT.ORDER_TOTAL}
Else
    0
WHere you are expecting to see a 0 are there any records that meet the criteria for the state group?

mlmcc
Your use of the word "blank" implies that there is a place for the month total, but the field is blank, instead of 0.  Is that what's happening, or does the month actually not show up at all (IOW, the total field isn't really blank.  There is no total field for that month) ?

 Assuming that there actually is a total field for the month and the field is blank, where is the field?  If it's a group footer, which group?  Or is it in a detail section or somewhere else?

 James
Avatar of Carlo

ASKER

There are no records for that month so therefore it does not show anything. I want to put a value of Zero. There is no total field for that month.

The field is in the Group Footer.
Can you show what the report looks like or upload the rpt file?

There are tricks that can be used but the method depends on the structure of the report.

Basic trick is to keep track of the month range and before printing a month see if you are missing any months.  WHere and how this is done depends on the report structure and where you are displaying the values.

mlmcc
Avatar of Carlo

ASKER

That is how the output looks like.
Not sure if I should upload the RPT here in public but if u give me your email I could send it to you.

Thanks.
Avatar of Carlo

ASKER

See attached.
RPT.png
Are you concerned about the report design or the data?

You can save it without data if it is the data that concerns you.

mlmcc
Avatar of Carlo

ASKER

True that. The report is working fine and its doing its job.
I just want it to show zero but if this is a problem then I will leave it the way it is now.
I'm not sure if you understood this, but after you expressed concerns about posting the report file in public, mlmcc was asking if it was the data in the report that you were concerned about, or just the report design itself (maybe it includes some proprietary information).  If you're just worried about the data, you could post the report file without any data.

 James
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Carlo

ASKER

Thanks!