Crystal Reports - Formula to find a certain value

Posted on 2014-08-13
Last Modified: 2014-08-13
I need to search through a data column to see if a specific value exists.  If it does i need my formula to display true.  If the value does not exist i need it to display false.  I want to display this in my Page Header.
Question by:jnikodym
    LVL 100

    Accepted Solution

    Are you trying to see if that value is on that page or in the report?

    If in the report try this

    Create a formula
    Name - HasMyValue
    If {YourFIeld} = YourValue then

    Open in new window

    Create another formula to display in the page header
    Sum({@HasMyValue}) > 0

    Open in new window


    Author Comment

    I'm trying to determine if that value exists once the report has run with the parameter selected.  I don't have the value in my report.  So, say there is a column in my dataset called City.  I won't to search all the values in that column and determine if the  city St. Louis exists in the column.  If it does, return true, if not, return false.
    LVL 100

    Expert Comment

    That pair of formulas will do what you want.  

    Did you try it?


    Author Comment

    that works, thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    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…
    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…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 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

    12 Experts available now in Live!

    Get 1:1 Help Now