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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 8.5 grouping puzzle with 8 attributes

Status
Not open for further replies.
May 21, 2001
52
US
Ok, I have a record. Each record has 8 attributes that are either true or false. A record can have multiple attributes that are true. So, how do I group by the true attributes and have a record print multiple times...once under each attribute grouping?

This is what I have so far:

SELECT 'Y'
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX1}: "REDEEMED AFTER EXPIRATION DATE"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX2}: "VOUCHER NOT PROPERLY EXECUTED"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX3}: "VOUCHER IMPROPERLY IDENTIFIED"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX4}: "DEPARTMENT NOT PROPERLY IDENTIFIED"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX5}: "MISSING RECEIPT OR VOUCHER"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX6}: "VOUCHER NOT STAMPED REDEEMED"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX7}: "NO REASON GIVEN"
CASE {CNE_CMPEXP_EXCEPTION.CNE_CHECKBOX8}: "CASH PRIZE ACCEPTED"


The problem is..when it groups, it prints the record under the first true attribute then goes onto the next record without evaluating the other attributes. I have also tried a FOR LOOP and got some bizarre results...non of which came close to what i was trying to accomplish.

Any suggestions?
 
Better to post example data and expected output.

if you have multipla attributes, and you want to display for each attribute, one would think that you would group byt he attribuyte, but it's impossible to tell from your description.

-k
 
You could do a union all that would place all checkboxes in one field with text identifiers distinguishing the different types. Then you would be able to group on the text field, and get multiple results. This is tougher to do in 8.5, since you don't have commands available, but still doable in the "Show SQL Query" area. However, we'd need to know more about the overall report.

It might be just as simple for you to create a main report with the 8 fields represented, and then to link a subreport to each where you limited the subreport results in each case to "Y" results--if your overall goal is to display a list of those "Y" respondents.

-LB
 
Thanks lbass. Both sound like good ideas. I did not think of it before. That has given me some ideas.

Thanks again.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top