Link to home
Start Free TrialLog in
Avatar of mowit
mowit

asked on

Help with formula

I have the following formula in the detail section of a sub report I'm expecting it to first check the groups then the Boolean if all the criteria is met then do the summing. My code isn't working, any suggestions. I also tried a record selection formula of which is also pasted below  

Detail Section

whileprintingrecords;
if
(
{somefield.unbdTitleGroup} <> 'Tax' and
{somefield.unbdTitleGroup} <> 'Officers' and
{somefield.unbdTitleGroup} <> 'Senior consultants' and
{somefield.unbdTitleGroup} <> 'Economic analysts' and
{somefield.unbdTitleGroup} <> 'Economic Research Staff' and
{somefield.unbdTitleGroup} <> 'Other Professional services'
) and

{somefield.IsExcluded} = false then

numbervar otherChrges := otherChrges + {somefield.PresAmt}

Record selection formula

not isnull({somefield.unbdTitleGroup}) and
len(trim({somefield.unbdTitleGroup})) <> 0 and
{somefield.unbdTitleGroup} <> 'Tax' and
{somefield.unbdTitleGroup} <> 'Officers' and
{somefield.unbdTitleGroup} <> 'Senior consultants' and
{somefield.unbdTitleGroup} <> 'Economic analysts' and
{somefield.unbdTitleGroup} <> 'Economic Research Staff' and
{somefield.unbdTitleGroup} <> 'Other Professional services'


Avatar of lisa_mc
lisa_mc
Flag of United Kingdom of Great Britain and Northern Ireland image

hi mowit

when you try this in crystal what error mesage are you getting
Avatar of mowit
mowit

ASKER

Not getting an error its still calculating the groups I'm trying to exclude
try changing and to or

as shown below
whileprintingrecords;
if 
(
{somefield.unbdTitleGroup} <> 'Tax' or
{somefield.unbdTitleGroup} <> 'Officers' or
{somefield.unbdTitleGroup} <> 'Senior consultants' or
{somefield.unbdTitleGroup} <> 'Economic analysts' or
{somefield.unbdTitleGroup} <> 'Economic Research Staff' or
{somefield.unbdTitleGroup} <> 'Other Professional services'
) and

{somefield.IsExcluded} = false then

numbervar otherChrges := otherChrges + {somefield.PresAmt}

Open in new window

Avatar of mowit

ASKER

That was how i initially wrote the code, doesn't work.
Avatar of Mike McCracken
How are you displaying the value?

Since it is in a subreport, are you resetting it anywhere?

Did you declare it anywhere else?

mlmcc
Avatar of mowit

ASKER

I'm only resetting the otherChrges  numbervar in the group header. Not declaring it anywhere else except for where I'm doing the summing.
Avatar of mowit

ASKER

oh yea and I'm displaying it in the footer of the group.
Avatar of mowit

ASKER

So it appears that my formula is working, i unsuppressed the detail section and they all show 0.00 why then is the footer section showing the total. It should be zero.

Capture.PNG
ASKER CERTIFIED SOLUTION
Avatar of mowit
mowit

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi again

sorry I am really confused and a bit lost

this is what i think you are doing!!

 r u doing a running total on a field based on the conditions between line 1 and line 12.  Then you want to display this count in the group footer and then when the group changes reset this value to 0

am I on the right lines
Avatar of mowit

ASKER

I was looking at the wrong field basically. The grand total is displayed on the main report.
Avatar of mowit

ASKER

resolved on my own