Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining Return information

Status
Not open for further replies.

Kim296

MIS
Aug 24, 2012
98
US
I have a report that I group by Nature. The nature field has many returns.

(ex. Theft by Shoplifting, Theft by Taking (Auto), Theft by Taking (From Building), Burglary Dwelling (Forced), Burglary Dwelling (Non-Forced), etc.......)

I have tried to combine the natures for a specific report, so that all calls that relate to theft will be listed once under "Theft" with addresses and all calls that relate to a burglary will be listed once under "Burglary" with addresses.

I used the following formula and it does list them as "Theft" or "Burglary", but the problem is that is still list each event seperately.
This is the formula that I've tried:

IF ({lwchrg.arr_chrg})="BURGLARY FIRST DEGREE(DWELLING,FORCIBLE ENTRY)" THEN "BURGLARY DWELLING" ELSE IF
({lwchrg.arr_chrg})="BURGLARY FIRST DEGREE(DWELLING,NON-FORCED)" THEN "BURGLARY DWELLING" ELSE IF

({lwchrg.arr_chrg})="BURGLARY SECOND DEGREE(NON-DWELLING, FORCIBLE ENTRY)" THEN "BURGLARY NON-DWELLING" ELSE IF
({lwchrg.arr_chrg})="BURGLARY SECOND DEGREE(NON-DWELLING, NON-FORCED)" THEN "BURGLARY NON-DWELLING" ELSE IF

({lwchrg.arr_chrg})="THEFT BY CONVERSION" THEN "THEFT (OTHER)" ELSE IF
({lwchrg.arr_chrg})="THEFT BY CONVERSION OF PAYMENTS PROPERTY IMPROVEMENTS" THEN "THEFT (OTHER)" ELSE IF
({lwchrg.arr_chrg})="THEFT BY DECEPTION" THEN "THEFT (OTHER)" ELSE ({lwchrg.arr_chrg})


Is there a way that I can get my desired results to lump together?


Example of Original results:
Theft by Taking (Auto)
123 Street Name, City - Unsolved

Theft by Shoplifiting
132 Street Name, City - Solved, Arrest Made

Theft by Taking (Other)
234 Street Name, City- Unsolved

Burglary Dwelling (Forced)
456 Street Name, City, - Unsolved


Example of what I am getting after my formula:
Theft
123 Street Name, City - Unsolved

Theft
132 Street Name, City - Solved, Arrest Made

Theft
234 Street Name, City- Unsolved

Burglary
456 Street Name, City, - Unsolved




Example of what I am trying to accomplish:
Theft
123 Street Name, City - Unsolved
132 Street Name, City - Solved
234 Street Name, City, - Unsolved

Burglary
456 Street name, City, - Unsolved


 
Have you tried inserting a group on your new formula field? If that doesn't work, plase explain more about the structure of your report, ie, what fields are in which section.

Cheers
Pete
 
As pmax9999 says, group on your field and it should work.

If you've already done this, then I'd look for some subtle differences, maybe a stray space. I note your formula should return THEFT (OTHER) but you show Theft.

I'd suggest you rewrite and split, something like
Code:
"BURGLARY" in  {lwchrg.arr_chrg}

Code:
"NON-DWELLING" in  {lwchrg.arr_chrg}

Code:
"THEFT" in  {lwchrg.arr_chrg}

Code:
If  @Burglary
    then if @NonDwell then "a) Burglary Non-Dwelling"
                      else "b) Dwelling Burglary"
else if @Theft then "c) Theft"
               else "d) " & {lwchrg.arr_chrg}

If it gives trouble, you can display the tests, which will say "True" or "False" on the report.

I've put a prefix so you can use names distinct from the desired alphabetic order.

Sincle multiple tests produce a single literal, there should not be multiple group items.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
MADAWC, Thank you so much! That worked perfectly for what I was trying to accomplish. I appreciate your time and help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top