Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: SOLVED - Help with formula / running total Post Reply Post New Topic
Author Message
joeb
Newbie
Newbie


Joined: 07 May 2014
Online Status: Offline
Posts: 2
Quote joeb Replybullet Topic: SOLVED - Help with formula / running total
    Posted: 07 May 2014 at 7:33am

Hopefully fresh eyes will offer some insight.

What I'm trying to do is get a total count of "unclaimed" services.

An "unclaimed" service is a service that has a balance of greater than zero and no associated "claim" record.

- @Claimed -
IF ISNULL({CLAIM.ID}) AND SUM({@Balance}) > 0 THEN
    1 //"Unclaimed"
ELSE
    0 //"Claimed"

Balance is calculated by the SUM of each revenue line

 - @Balance -
 {REVENUE} - {PAYMENT} + {TRANSFER} - {ADJUST}

The @Claimed formula is on the group 1 footer and the @Balance formula is within the details. There can be multiple revenue lines, and the sum of each @Balance line is the remaining balance of that service.

The @Claimed formula works as expected - however I need to be able to get a SUM of all the "unclaimed" records (@Claimed) - but you cannot get a Running Total of a Running Total. So I would really appreciate some fresh eyes on the issue. I'm sure I'm attacking this the wrong way.

Report Layout

The report layout is as follows:

Main Service Details
GH1a | Service Date   - Service ID   - Etc
GH1b | {SERVICE.DATE} - {SERVICE.ID} - {ETC}

Service Revenue Line Details 
GH1c | Revenue   - Payment      - Transfer   - Adjustment   - Balance
D    | {REVENUE} - {PAYMENT}    - {TRANSFER} - {ADJUSTMENT} - {@Balance}

Service Revenue Totals
GF1b |  Claimed    - Revenue      - Payments      - Final Balance
GF1c |  {@Claimed} - RT {REVENUE} - RT {PAYMENTS} - RT of {@Balance}

ALL Services Revenue Totals
RFa  | Total Unclaimed - Total Revenue - Total Payments  - Total Balance
RFb  | ???             - RT            - RT              - RT of {@Balance} no reset

RT = Running Total Fields



Edited by joeb - 07 May 2014 at 8:15am
IP IP Logged
joeb
Newbie
Newbie


Joined: 07 May 2014
Online Status: Offline
Posts: 2
Quote joeb Replybullet Posted: 07 May 2014 at 8:17am
I was able to fix this by using a formula that increments as the value repeats:


Shared NumberVar ClaimTotalVar;
ClaimTotalVar := ClaimTotalVar + {@ClaimedInt};
ClaimTotalVar

I placed that in the subtotal footer

Then displayed it in the report footer with another formula:

Shared NumberVar ClaimTotalVar;
ClaimTotalVar

IP IP Logged
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.