Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Running total not working correctly Post Reply Post New Topic
Page  of 3 Next >>
Author Message
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Topic: Running total not working correctly
    Posted: 04 Oct 2017 at 10:54am
Hello all -

Im trying do a running total on the amount but its not functioning correctly.

Here's my data below. I have a Grouping on (EMPID)

   NAME      TAXID   POLICY    AMT
GH
D   KIM       3527    JKC74     144
D   KIM       3527    JKC74     716
D   MARSHALL 7896    JKC74     716
D   MARSHALL   7896   JKC74     144

GF    


How to achieve the Sum AMT as $860 on the Group footer?     
    NAME      TAXID   POLICY AMT


Output needed as



GF   KIM      3527    JKC74     $860      860

Edited by Nav522 - 11 Oct 2017 at 4:37am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2017 at 3:04am
why is marshall excluded?
how do you know to not include it from a data perspective?
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 11 Oct 2017 at 4:12am
I think it gives either one of the NAME because of the grouping.

For me doesn't matter which NAME it returns in GF Its the DISTINCT sum for the whole Group that is what i'm looking for. Makes sense?



Edited by Nav522 - 11 Oct 2017 at 4:54am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2017 at 7:15am
but what field identifies it as a unique value to include in the sum once?
order on that field (inside the group) and change your RT to evaluate on change of that field.
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 11 Oct 2017 at 7:26am
The TRANS ID

There are different amounts for each TRANS ID but the data backend returns multiple rows for the same amount.

Here it is the actual data

NAME          TID    TRANSID    POLICY    AMT
GH
D   KIM       3527     DU    JKC74     144
D   KIM       3527     DU    JKC74     144
D   KIM       3527     DU     JKC74     0
D   MARSHALL 7896     RO    JKC74     716
D   MARSHALL   7896     RO   JKC74     716

GF(POLICY)

I did a running total on the amount with evaluate on TRANS ID and reset on POLICY but im getting skewed SUM.


I tried a formula in evaluate AMOUNT<> Previous (AMOUNT) but still it doesn't add up
     





Edited by Nav522 - 11 Oct 2017 at 7:33am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2017 at 7:57am
maybe this?
sort on transID
set your RT to a SUM of AMT
set the evaluate for on change of field = TransId
set the reset for on each group -
place the RT in the group footer

Edited by DBlank - 11 Oct 2017 at 7:58am
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 11 Oct 2017 at 8:10am
Thanks that worked. But I have a second report where I have to capture a differences of two TRANSID
i.e. SUM(DU) and SUM(RO) and show the difference between them

So basically I have to show 716 - 144 = 562

But the RT includes the duplicates and giving me 1144. ANy workaround?

Edited by Nav522 - 11 Oct 2017 at 8:11am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2017 at 8:17am
you know your data so not sure if this logic applies but...
create a formula and multiply the AMT by (-1) for when the rowfield="RO" then do the same RT sum but sum the formula field not the AMT field.

Edited by DBlank - 11 Oct 2017 at 8:17am
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 12 Oct 2017 at 4:04am
That did it but where ever the difference between "RO" and "DU" is equal to 0. It is putting blank field instead on 0. Is there a way to suppress the whole row for that specific problem?

I tried Suppress formula on GF as DIFF = 0 but t doesn't work
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Oct 2017 at 5:02am
is it really zero or NULL?
make sure your multiplier by -1 formula is using default values for NULLs
IP IP Logged
Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.