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

Multiple value field display

Status
Not open for further replies.

JessicajOwen

Technical User
Jan 31, 2006
9
GB
Hello,

I'm using CR XI against an Oracle Database...

I have a report which contains a field which could have multiple values in it (the number of values can vary) or could just have a single value in it. Multiple values are separated by commas.

If the field has multiple values in it I need to display these as separate entries in the report, and then do a summary count against each value. These values can't be hardcoded into a formula as they change all the time, and this would cause huge report maintenance issues.

Example:

My report is grouped by date, so, for a certain date my report looks like this:

03/04/2006 31
Childcare Pack 1
DSA Pack 1
DSA Pack, Full time Student Pack 2
Full time Student Pack 24
Full time Student Pack, Childcare Pack 1
Full time Student Pack, DSA Pack 2

I actually need the report to list each entry separtely and count how many times it has been requested, so using the figures above, I want my report to look like this:

03/04/2006 36
Childcare Pack 2
DSA Pack 5
Full time Student Pack 29

Can anyone help please?
Thank you!
Jessica
 
Spliting out the multiple values is fairly easy. You'd get the first using
Code:
Split({your.data}, ",")[1]
The second as
Code:
Split({your.data}, ",")[2]
Continue for however many their could be. Test IsNull before trying to handle values that may not be there, otherwise the formula will stop.

Counting them without hard-coding is another matter, I don't see a way to do it. Since each detail line or 'row' can be counted for several different totals, the standard methods of summary or crosstab wouldn't work.

What you could do is parameterise the values to be looked at. This would reduce the amount of work when something changes.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I think you just need to use Madawc's first formula:

Split({your.data}, ",")[1]

...and insert a group on that. You can then insert summaries of your data at this new group level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top