Solved

Trying to conditionally count a field and produce the total in the Page header.

Posted on 2013-11-28
3
965 Views
Last Modified: 2013-11-28
I'm looking to run a count on a field {HazItem} which returns either true or false.  The count should be based on if the field value is true.  This total should be accessible in the page header.  I can get it to work correctly in the footer sections, but not in the header.  The problem is the value of this formula is needed in order to feed logic in another condition on the page header.  I know that the documents execution order is what's causing this problem, but surely there must be a workaround.

I've tried adding a formula in the details section:

if ({HazItem}=true) then {HazItem}

And then in another formula ran a count against it:

count({formula}) / count({formula}, {GROUP})
0
Comment
Question by:peterseychelles
  • 2
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39683607
Try this way

if ({HazItem}=true) then 1

Now use SUM instead of COUNT

sum({formula}) / sum({formula}, {GROUP})

mlmcc
0
 

Author Closing Comment

by:peterseychelles
ID: 39683692
God, I can't believe I didn't think of that, I was so fixated on using the count function I hadn't considered doing it like that.  That does the trick, thanks mlmcc.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39683942
Count just counts records so if you are trying to filter the rcords to count only some of them then you need to use a trick like that.  Count doesn't look at the value just that there is a recod.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

864 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now