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

Group on array variable

Status
Not open for further replies.

balajee

Programmer
Jun 29, 2000
134
NZ
Hi

I have a table from which I would like to group on values in 3 different fields. The structure of these fields i same but the values may same as in other 2 or different. Is there any way to group on values from these 3 fields?

Thanks

balajee
 
Do you mean like this:

Group by Countries first,
Group by Regions within each Country,
Group by Cities within each Region? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
No.

They contain similar data values. Like for example:

Item1 may contain- "ADD-ONS", "ANALOGUE", "GATEWAY"

Item2 may contain- "GATEWAY", "ADD-ONS", "VOICEMAIL"

Item3 may contain- "ANALOGUE", "GATEWAY", "OS-DDI"

There are 3 other fields related to each of these named as
Item1-No, Item2-No, Item3-No which contains numeric value.

What I want is to count nos for each data value in Item1,Item2 and Item3. So after the report is run I should get some kind of following report:

Item No
---- --

ADD-ONS 15
GATEWAY 5
ANALOGUE 26
OS-DDI 20

I hope this is clear.

Please let me know if you have need any other info.

Thanks
 
So you want one record to be part of three different groups. No that won't work.

If you know SQL well, you could write a stored procedure that reads each 2-column pair as a separate 'table', and then appended each pair's records, in turn, to the others. Crystal can't do a union query like this directly.

If the number of items that occur in these three fields is not huge, you could hard code a conditional total or each item and then sum the items using a running total for each.

If you really want a challenge, I suppose you could create a pair of variable arrays, one to keep track of the items, and the other to maintain a corresponding counter for each item, but that would test the limits of Crystal's variable arrays. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top