cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate Sum of records that are not Suppressed

Former Member
0 Kudos

Hi All Experts,

I have Created A layout for SAP B1 in crystal report.Because of Some Condition I have  to Suppress Detail Section.

The Suppress Condition is As Follows

{ExcisePur.ItemCode}=Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum}=Previous({ExcisePur.Batchnum})

And it is Working Fine,the Desired Detail Section is Suppressed.

Now I Have to take Sum of Records ,But that records are also Calculated which are Suppressed.

For these I have Read Several post where someone had same problem,

there they have Asked to Create A Running Total And use the Formula in evaluate section same as in Suppress Condition but opposite of it.

I did the same thing using these Formula

{ExcisePur.ItemCode}<>Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum}<>Previous({ExcisePur.Batchnum})

But it is Calculating only the Suppressed Record But Not the Record which is to be Calculated.

Please help me to Accomplish this.

I am very Much blank where I am  going wrong.

Regards,

Gayatri Shukla

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Gayatri,

I'm not too sure why this isn't working as the logic seems correct.

Here's another way to do this:

1) Create another formula and place this on the Details Section:

whileprintingrecords;

numbervar x;

if onfirstrecord then

x := {Field_to_summarize}

else if {ExcisePur.ItemCode} <> Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum} <> Previous({ExcisePur.Batchnum}) then

x := x + {Field_to_summarize};

2) Create another formula and place this on the Report Footer:

whileprintingrecords;

numbervar x;


-Abhilash

Former Member
0 Kudos

Hi Abhilash Sir,

Thanks, for your Quick Reply.

Problem is Almost Solved,But I Have to not keep the Sum on Report Footer But on Group Footer.

And have to reset it After every Group.

How Could I Solve this.

Regards,

Gayatri Shukla

abhilash_kumar
Active Contributor
0 Kudos

OK. Just Create another formula and place this on the Group Header:

whileprintingrecords;

numbervar x := 0;


-Abhilash

Former Member
0 Kudos

Hi Abhilash Sir,

Fantastic It Worked !!!!

Thank you very much Sir.



Thanks And Regards,

Gayatri Shukla.

Answers (0)