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!

Charting help needed 1

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
US
I am using CR XI R2. I have a stacked bar chart that is setup as follows:

On Change of: Field A
Show Values: Field X, Field Y, Field Z

When you use the On Change Of option, your values have to be some sort of Summary operation (defaults to Sum). I want to chart the values of the last record in the group. Is this possible? If so, how? Here's some example data to further illustrate what I am looking to do...

Field A Field X Field Y Field Z
ABC 20 30 10
ABC 15 10 23
ABC 17 17 17
DEF 12 10 8
DEF 23 12 19

For ABC, I want to chart the values from the 3rd record (17, 17, 17) and for DEF I want the last record (23, 12, 19).

Any help would be greatly appreciated. Thanks...
 
What makes these the "last" records in the group? Is there a date field? A number field that shows a sequence?

-LB
 
Sorry I missed that little detail...there's a date field.
 
Insert a group on FieldA, and use FieldA as your "on change of" field, and then write three conditional formulas:

//{@x}:
if {table.date} = maximum({table.date},{table.fieldA}) then
{table.fieldx}

//{@y}:
if {table.date} = maximum({table.date},{table.fieldA}) then
{table.fieldy}

//{@z}:
if {table.date} = maximum({table.date},{table.fieldA}) then
{table.fieldz}

Use the three formulas as your summary fields (sum), and place the chart in the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top