on 08-22-2016 3:41 PM
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.
Hi Henriette,
Could you post both the formula logic and the Running Total logic please?
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.