cancel
Showing results for 
Search instead for 
Did you mean: 

Problem summarizing formula using running total (or equivalent formula).

0 Kudos

Hi, I am new to this, hope anyone can help. I am using Crystal Report 2013. I have made a formula returning a 0 when a running total is positive and returning a 1 when the running total is negative. I now would like to summarize the 1's on group level, but cannot use the summarize tool. When I make a summarize formula myself, I get an error, that it cannot summarize the field. I have tried to avoid the running total, by making this in a formula as explained on a number of forums, but this did not get me anywhere. The strange thing is, that I can amend the 1's and 0's as number by giving them a digit etc, so the report thinks it is a number, however when I want to make a sum, it is handled as text (boolean). Hope it is clear what I am looking for.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Henriette,

Could you post both the formula logic and the Running Total logic please?

-Abhilash

0 Kudos

Formula "AmountReset" in group header 1:

WhilePrintingRecords;

NumberVar Amount := 0;

Formula "RunningTotal" in details:

WhilePrintingRecords;

NumberVar Amount;

Amount := Amount + {xxx_voorraad_alle_mutaties.aantal_transactie};

Formula "AmountDisplay" in group footer 1:

WhilePrintingRecords;

NumberVar Amount ;

-----

Formula "alarm"

if

({@RunningTotal}<0 and ({xxx_voorraad_alle_mutaties.orderregelafldat} > CurrentDate ))

then 1 else 0

abhilash_kumar
Active Contributor
0 Kudos

1) Modify the 'RunningTotal' formula on the Details to:

WhilePrintingRecords;

NumberVar Amount;

Numbervar cnt;

Amount := Amount + {xxx_voorraad_alle_mutaties.aantal_transactie};

If Amount < 0 AND {xxx_voorraad_alle_mutaties.orderregelafldat} > CurrentDate then

     cnt := cnt + 1;

Amount;

2) Create another formula to display the count and place this on the Group Footer:

WhilePrintingRecords;

Numbervar cnt;


3) Modify the 'AmountReset' formula to:


WhilePrintingRecords;

NumberVar Amount := 0;

Numbervar cnt := 0;

-Abhilash

0 Kudos

Wow!!! You will not believe how much time I spent, and "specialists" I asked for, however this works! Many thanks!!!!!!!!!!!!

Answers (0)