Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: cant summarize field Post Reply Post New Topic
Author Message
spl1
Newbie
Newbie
Avatar

Joined: 18 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 20
Quote spl1 Replybullet Topic: cant summarize field
    Posted: 19 Jun 2009 at 4:47am
I have created a formula to calculate national insurance from gross pay, therefore if paid less than £105 then 0, else if paid over £105 then *0.128 to declare national insurance value per person - formula below
However, i need to subtotal the national insurance for each group that i have in the report (3) but if i  sum(nationalinsurance, groupname) crystal tells me the filed cannot be summarised - HELP.....
 
//nationalinsurance
if ({@gross pay person})>110
then ({@gross pay person}-110)*0.128
else 0
Sarah
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Jun 2009 at 6:27am
shared variables is you only option.  probably something like this:
shared numbervar sumIns;
local numbervar locSum;
//nationalinsurance
if ({@gross pay person})>110 then
 locSum := ({@gross pay person}-110)*0.128
else
 locSum := 0;
 
sumIns := locSum;
 
locSum    //this assumes that you want to see the insurance paid on a detail line, otherwise, replace the last line with ""
 
When you want to see the summary, easy peasy:
shared numbervar sumIns
 
all done.
 
HTH
IP IP Logged
spl1
Newbie
Newbie
Avatar

Joined: 18 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 20
Quote spl1 Replybullet Posted: 19 Jun 2009 at 11:26am
sorry... i've added the
shared numbervar sumIns;
local numbervar locSum;
//nationalinsurance
if ({@gross pay person})>110 then
 locSum := ({@gross pay person}-110)*0.128
else
 locSum := 0;
 
sumIns := locSum;
 
into my formula which works great but sorry still cant get the summary bit. lol sorry
Sarah
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.