cancel
Showing results for 
Search instead for 
Did you mean: 

Total formual field counting supressed numbers

Former Member
0 Kudos

Hello,

I am using CR 2008.  I have two fields, Quoted Price and Quantity Order which I made a summary field ({Table.QuotedPrice}) * ({Table.QuantityOrder}); which works great.  My issue is I have a Total field that I made trying to sum up all the summary field in the details part of the report.  Unfortunately the Quoted Price field and Quantity Order fields have duplicated data in the tables so I I have to check the box; Suppress If Duplicated.  The Total summary field is still summing up the suppressed columns which is giving me the wrong total.  Not really sure how to fix this issue.  Thanks in advance, Eric

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Eric,

Here's what you need to do:

Modify the Summary formula that is placed on the details section to include this code:

WhilePrintingRecords;

numbervar c;

numbervar array a1;

numbervar t := {Table.QuotedPrice}*{Table.QuantityOrder};

if not(t in a1) then

(

    c := c + 1;

    redim preserve a1[c];

    a1[c] := t;

)

else t;

Create another formula to display the total and place it on the Report Footer:

WhilePrintingRecords;

numbervar array a1;

numbervar i;

numbervar tot;

for i := 1 to ubound(a1) do

(

    tot := tot + a1[i];

);

tot;

Let me know how this goes!

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

100% solved my issue!  Thank you so much. 

Answers (0)