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

bring data up through groups

Status
Not open for further replies.

djieon

Technical User
Aug 19, 2008
107
GB
Hi All,

Right I am working with some data at group 5 level, but for each record at that level there are 5 records in a different table. I have then added the 5 records in at group 6 level but obviously I am now getting 5 entries at group 6 level plus my original entry, which i want, at group 5 level.

Is there any way of me bringing the data up from level 6 to level 5.

thanks in advance

David.
 
A bit vague but I suspect you are referring to a total where you wish to avoid duplicating the amount. You can do so by creating a Running Total and setting the evaluation frequency option to the level 5 grouping.

hth,
- Ido

view, email, export, burst, distribute, and schedule Crystal Reports.
 
You want to show the names of Group 6 items in the Group 5 header, while showing their amounts in Group 6 headers or detail lines? Tricky.

You can collect items using variables in the detail line. The drawback is that it can't be in the group header, it would have to go in the footer. I can't see any way round, except to use a subreport which will duplicate the task and slow processing.

In either case, try adapting something I wrote to collect postcodes:
Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} +", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field in the group header.
whileprintingrecords;
stringvar pst := "";
Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
thanks for the reply. I dont know if it makes a diffrerence but I actually want to show the values from group 6 in group 5 as well as the headers! Does that make it easier or harder?
 
You could either try inserting a crosstab in the box that uses the group #6 field as the row, with a maximum of the group#6 field as the summary, and then suppress one of them (the row label or the summary) and remove the grid, or you could try using formulas that use NthLargest (or NthSmallest), as in:

NthSmallest(2,{table.group#6field},{table.group#5Field})

In this example, for the second smallest--which could be a number or a letter that is the second earliest in the alphabet.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top