Print Page | Close Window

Summarise a formula

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17894
Printed Date: 06 May 2024 at 5:53am


Topic: Summarise a formula
Posted By: bendrick
Subject: Summarise a formula
Date Posted: 31 Oct 2012 at 11:45pm
I have a formula field that I need to summarise. The formula is as follows:

if sum({Command.MR},{Command.JN})= 0 then 0 else 1

I know it's not possible to summarise a formula that contains a sum but have no idea how to get around it

Any help appreciated

Thanks
Ben



Replies:
Posted By: lockwelle
Date Posted: 01 Nov 2012 at 8:25am
you can create a shared variable and increment it as needed:
shared numbervar aSum;
local numbervar temp;
if sum({Command.MR},{Command.JN})= 0 then temp:=0 else temp:=1;
aSum := aSum + temp;
temp
 
later you can display the summary with:
shared numbervar aSum;
aSum
 
HTH



Print Page | Close Window