[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Help with formula

Posted on 2011-05-03
12
Medium Priority
?
343 Views
Last Modified: 2012-05-11
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'


0
Comment
Question by:mowit
  • 8
  • 3
12 Comments
 
LVL 3

Expert Comment

by:lisa_mc
ID: 35512215
hi mowit

when you try this in crystal what error mesage are you getting
0
 

Author Comment

by:mowit
ID: 35512258
Not getting an error its still calculating the groups I'm trying to exclude
0
 
LVL 3

Expert Comment

by:lisa_mc
ID: 35512295
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:mowit
ID: 35513004
That was how i initially wrote the code, doesn't work.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35513050
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
 

Author Comment

by:mowit
ID: 35513078
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
 

Author Comment

by:mowit
ID: 35513111
oh yea and I'm displaying it in the footer of the group.
0
 

Author Comment

by:mowit
ID: 35513284
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
 

Accepted Solution

by:
mowit earned 0 total points
ID: 35513371
Sorry i figured it out I'm actually displaying the results on the main report. All is working I fixed the formula
0
 
LVL 3

Expert Comment

by:lisa_mc
ID: 35513377
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
 

Author Comment

by:mowit
ID: 35513472
I was looking at the wrong field basically. The grand total is displayed on the main report.
0
 

Author Closing Comment

by:mowit
ID: 35714827
resolved on my own
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question