Crystal 8.5 Professional (8.5.0.217)
oRACLE 8I
Oracle ODBC Driver
I have the following tables linked
Arrest -> Arrest_Charges -> Charge_Codes
-> Names
Arrest.nameid = Names.nameid and
Arrest.arrestid = arrest_charges.arrestID and
arrest_charges.statute = Charge_codes.statute
Each individual arrested may have one or many statutes.
Each statute (over 1500) is group into 30 categories based
of federal severity guidelines.
The categories start with
01 (Murder)
02 (Rape)
03 (Robbery)
04 (Aggravated Assault)
... and ending with
28 (Vagrancy)
29 (Curfew & Loitering)
30 (Runaway)
Unfortunately, we don't have a table of categoies so I created a formula, @category, that assigns each statute to a given category.
Objective:
Within each category, provide totals by age, sex and race demographics
Rules:
Each arrestee can only be counted once based on the most severe crime (or category)
Approach:
I grouped by arrestID and inserted a minimum on category. This gave me the right category to make my individual count by arrestee.
Problem:
How do I group the individual counts into each category?
Age Race Ethn Sex
< 18 18 19 20.... Wh Bl Ind As Hisp M F
Murder 0 0 0 1.... 1 1 0 0 0 2 0
Rape 0 0 1 0.... 1 0 0 0 0 1 0
Robbery 0 0 0 0.... 0 1 0 0 0 1 0
I tried grouping by Category but that caused an individual to be counted with every charge.
GH1- Category
GH2- ArrestID
Det- Charges
For example, if a person was charged with robbery and aggravated assault, then I am getting a count for both. I am getting a GH2 for the same person in both categories. In addition, the min(category) is the same as GH1. I just need to count the robbery since it is a higher classification than aggravated assault.
I deleted the category group (GH1) and went into Report -> Top N/Sort Group Expert and sorted min of category in descending sequence (yes, descending because when I did it in ascending sequence, the report GH1 came out in descending sequence. Can someone explain the logic in that?).
Anyway, the arrests are now sorted in the proper crime category sequence.
This is where I am stuck. What do I do next to get the individual arrest info into a higher summary? I was toying with the idea of using the charge Code table as my main report with the arrests as a subreport and linking the categories. Wouldn't that mean running the same arrests 30 times to get the data passed?
Is there something I can do in SQL expression? I am a total newbie in this area.
Any suggestions would be appreciated.
oRACLE 8I
Oracle ODBC Driver
I have the following tables linked
Arrest -> Arrest_Charges -> Charge_Codes
-> Names
Arrest.nameid = Names.nameid and
Arrest.arrestid = arrest_charges.arrestID and
arrest_charges.statute = Charge_codes.statute
Each individual arrested may have one or many statutes.
Each statute (over 1500) is group into 30 categories based
of federal severity guidelines.
The categories start with
01 (Murder)
02 (Rape)
03 (Robbery)
04 (Aggravated Assault)
... and ending with
28 (Vagrancy)
29 (Curfew & Loitering)
30 (Runaway)
Unfortunately, we don't have a table of categoies so I created a formula, @category, that assigns each statute to a given category.
Objective:
Within each category, provide totals by age, sex and race demographics
Rules:
Each arrestee can only be counted once based on the most severe crime (or category)
Approach:
I grouped by arrestID and inserted a minimum on category. This gave me the right category to make my individual count by arrestee.
Problem:
How do I group the individual counts into each category?
Age Race Ethn Sex
< 18 18 19 20.... Wh Bl Ind As Hisp M F
Murder 0 0 0 1.... 1 1 0 0 0 2 0
Rape 0 0 1 0.... 1 0 0 0 0 1 0
Robbery 0 0 0 0.... 0 1 0 0 0 1 0
I tried grouping by Category but that caused an individual to be counted with every charge.
GH1- Category
GH2- ArrestID
Det- Charges
For example, if a person was charged with robbery and aggravated assault, then I am getting a count for both. I am getting a GH2 for the same person in both categories. In addition, the min(category) is the same as GH1. I just need to count the robbery since it is a higher classification than aggravated assault.
I deleted the category group (GH1) and went into Report -> Top N/Sort Group Expert and sorted min of category in descending sequence (yes, descending because when I did it in ascending sequence, the report GH1 came out in descending sequence. Can someone explain the logic in that?).
Anyway, the arrests are now sorted in the proper crime category sequence.
This is where I am stuck. What do I do next to get the individual arrest info into a higher summary? I was toying with the idea of using the charge Code table as my main report with the arrests as a subreport and linking the categories. Wouldn't that mean running the same arrests 30 times to get the data passed?
Is there something I can do in SQL expression? I am a total newbie in this area.
Any suggestions would be appreciated.