Question

This question may have been asked already, however I'm not sure how to search for this specific problem.

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.

EDIT: More information

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

Was it helpful?

Solution

You can accomplish this by just adding the values as the value repeats. Something like below.

Shared numbervar Total;

Total:=Total+@claimed;
Total;

This will make sure value is added and result is displayed....

Place the formula in group footers.

Now create one more formula display and place it in report footer

Shared numbervar Total;
Total

OTHER TIPS

Try create a running total field:

Running total name = UnclaimedCount
Field to summarize = @Claimed
Type of summary = sum
Evalute = on change of group 1
Reset = never

Remember to grant that fields {REVENUE}, {PAYMENT}, {TRANSFER}, {ADJUST} are not null.

EDIT:: if @Claimed is a running total field (#Claimed), change it to be an usual formula.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top