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'


mowitAsked:
Who is Participating?
 
mowitAuthor Commented:
Sorry i figured it out I'm actually displaying the results on the main report. All is working I fixed the formula
0
 
lisa_mcCommented:
hi mowit

when you try this in crystal what error mesage are you getting
0
 
mowitAuthor Commented:
Not getting an error its still calculating the groups I'm trying to exclude
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
lisa_mcCommented:
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

0
 
mowitAuthor Commented:
That was how i initially wrote the code, doesn't work.
0
 
mlmccCommented:
How are you displaying the value?

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

Did you declare it anywhere else?

mlmcc
0
 
mowitAuthor Commented:
I'm only resetting the otherChrges  numbervar in the group header. Not declaring it anywhere else except for where I'm doing the summing.
0
 
mowitAuthor Commented:
oh yea and I'm displaying it in the footer of the group.
0
 
mowitAuthor Commented:
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
0
 
lisa_mcCommented:
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
0
 
mowitAuthor Commented:
I was looking at the wrong field basically. The grand total is displayed on the main report.
0
 
mowitAuthor Commented:
resolved on my own
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.