How to filter a data report

Posted on 2011-10-31
Last Modified: 2012-06-27
I have a report that right now display all quote number grouped by a date. In the 9/29/11 field I return quote numbers that are valid in both formats 10001 or 1000-1. The problem I need help with is that if a quote number is 1000-1 then it only returns that single number and not the 1000 number. The "-1" defines it as an updated quote so I would only want to display the most updated quote number.

I tried using an if else and a instr function but that did not do the trip.

Thanks in advance.
Question by:cmdolcet
    LVL 100

    Expert Comment

    Are you using a parameter in the filter?

    Are you doing any summaries in the report?

    LVL 14

    Expert Comment

    You could add a group by quote number (or really a group on a formula that is:

    Suppress detail lines, just showing group header.

    Insert a summary and choose Minimum, or Maximum of {table.quotefield} into the group header. Either MIN or MAX should should the quotes with -# if two quotes are present. Try both to see which yields your desired result.

    LVL 19

    Expert Comment

    Create a formula to extract the quote number part of the field.

    LVL 34

    Accepted Solution

    A variation on GJParker's and LinInDenver's suggestions.

     Create a formula like:

     Split ({quote # field}, "-') [ 1 ]

     That's more flexible than using Left ({quote # field}, 5), which assumes that you will always have 5 characters in front of the "-".  If there will always be 5 characters, then using Left is fine.

     Group on the new formula.  Within the group, sort on the quote # field (the field, not the formula).  Suppress the group header (And details?) and put the quote # field in the group footer, and you should see the largest quote # in each group.

     Note that this all assumes that the number after the "-" will always be 1 digit/character.  If you could have numbers like 10000-9, 10000-10, 10000-11, this won't work, because 10000-9 would sort after 10000-10 and 10000-11.  If you could have numbers like those, you'll have to do some more work to find the highest number.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    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. …
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now