Percentage Formula for Crystal reports
Percentage Formula for Crystal reports
(OP)
I am needing to pull only a percentage of names. Needing a formula for Crystal Reports. Thanks for any help with this!!
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
Percentage Formula for Crystal reports
|
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: Percentage Formula for Crystal reports
RE: Percentage Formula for Crystal reports
RE: Percentage Formula for Crystal reports
My approach would probably be along the lines of generating a random number for each record, sorting by that random number, then only returning the number of records required. There might be a better approach - will give it some thought.
Maybe this will get you heading in the right direction - let us know if you work it out in the meantime.
Hope this helps.
Cheers, Pete,
RE: Percentage Formula for Crystal reports
Create the following Formula and place it in the Details section (can be suppressed):
CODE
Sort the records on the new formula.
In the Section Expert for the Details section add the following Suppression formula:
CODE
This should return 10% of a randomised set of data.
However, it is not a very efficient approach as all records will be returned to the report from the database and 90% Suppressed. If it is a large data set it may be slow.
If so, and you can tell be what the database is (ie, SQL Server, Oracle etc) I might be able to help you with a better solution.
Let me know how it goes.
Regards
Peter
RE: Percentage Formula for Crystal reports
It worked. Thank you very much!!
Is there a way that when I refresh the report that it would pull a new set of 10 percent. It is currently not changing the selection upon refreshing the report.
RE: Percentage Formula for Crystal reports
What happens if you close the report and re-open it - does it still return the same records? What version of Crystal are you running? Are you running the report natively in Crystal or through another application?
Cheers, Pete.
RE: Percentage Formula for Crystal reports
RE: Percentage Formula for Crystal reports
Hopefully someone else has seen this issue before and knows how to fix it.
Sorry I can't be more help.
Cheers
Pete
RE: Percentage Formula for Crystal reports
{OFFENDER_BOOKINGS.ACTIVE_FLAG} = "Y" and
not ({OFFENDER_EXTERNAL_MOVEMENTS.MOVEMENT_REASON_CODE} in ["INT", "RAB", "RECA"]) and
{OFFENDER_EXTERNAL_MOVEMENTS.MOVEMENT_TYPE} = "ADM" and
{LIVING_UNITS.DESCRIPTION} startswith ["NDSP-BIU-GPE", "NDSP-EU", "NDSP-MTU", "NDSP-NU", "NDSP-OU", "NDSP-SU", "NDSP-WU"] and
not ({OFFENDER_EXTERNAL_MOVEMENTS.TO_AGY_LOC_ID} in ["DEFP", "NTAD"])
RE: Percentage Formula for Crystal reports
One way to test it would be to remove it and see what happens. If that fixes it, you could re-write the report using a Command so as to avoid the need for a Record Selection Formula - a bit of messing around but it is perhaps worth a try.
RE: Percentage Formula for Crystal reports
Also, do you have any sort order applied other than the sort on the formula containing RND(100), or other conditional suppression formulas in the report. Either of these are likely to impact the way it works.
If you post a copy of the report file I can take a look.
Cheers
Pete
RE: Percentage Formula for Crystal reports
I took a further look at it and it is pulling the first 100 records every time and not randomly.
RecordNumber > Count({OFFENDERS.ROOT_OFFENDER_ID})*10/100 (this is the formula I have entered in the Section Expert Details section)
RE: Percentage Formula for Crystal reports