Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total Issue

Status
Not open for further replies.

ekta22

IS-IT--Management
May 3, 2004
359
US
Hi,

I am using Crystal XI and Oracle 10g.

I have a Running Total in the detail section of my report. I have two Groups in the report, Type and Name. The running total works fine except when Name field is NULL. For example if the running total is 10 and Name field is Null it shows the count from 1 to 10 in the detail section. If Name field is not Null it just shows the total 10 in the detail secton instead of showing numbers 1 to 10.
Running Total is count of another field, Evaluated for each record and Reset is based on a formula which uses the Name field. Code looks like this

Code:
{F.TYPE}<> PREVIOUS ({F.TYPE}) 
OR {F.NAME} <> PREVIOUS ({F.NAME})

Both the GH1 and GH2 has 'underlay following sections' checked. Don't know why this happens?

Thanks!
 
This is unclear. Can you show sample data? It is also unclear what you want this rt to show in the detail section.

The problem is that you are referencing a potentially null field in your reset formula, so it doesn't evaluate when it hits a null.

-LB

 
If you're testing fields that might be null, you need to test for this first, otherwise the formula will stop without output. E.g.
Code:
if not Isnull({F.TYPE})

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
This is how it looks

Type Name RunningTotal
AAA----A------5
BBB----B------2
But if Name is BLANK for type AAA then this is what it does
AAA---- ------1
--------------2
--------------3
--------------4
--------------5
BBB----B------2

Do I need to test Isnull({F.TYPE}) on Running Total Reset Formula?

I have also attached a screenshot. Page1 show how it should look but on page2 you will see that it shows all the counts when TYPE field is blank.
 
 http://www.ambrix.com/Screenshot.doc
I think you must have a suppression formula on your detail section. What is it?

-LB
 
Yes, I do.

Code:
({#rec-count}<=0 AND {#fm-count}=0 AND {#pm-count}=0)
OR
(
  {F.TYPE}=Next ({F.TYPE}) AND
  {F.NAME}=Next ({F.NAME}) AND
  
)
 
Try changing it to:

(
{#rec-count}<=0 AND
{#fm-count}=0 AND
{#pm-count}=0
) OR
(
(
nextisnull({F.NAME}) or
{F.NAME}=Next ({F.NAME})
) AND
{F.TYPE} = Next ({F.TYPE})
)

You'll have to play with this, but it looks to me like this is a suppression issue, not a reset issue, although it might be best to build in a null check in that also.

-LB
 
Thanks LB! Using isNull for F.NAME worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top