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

Capture Value from top record 2

Status
Not open for further replies.

csjoseph

MIS
Jan 2, 2001
247
US
I have a problem. I have a report that is grouped by lot numbers. I am reporting on a transaction table. Each record has beginning qty, trans_qty, lotno, etc. I want to put the first beginning qty value on the group footer. I can not find a way to do this.

Please help.

Chris
IS Manager
 
Create a formula that you can put into you group header to capture the beginning qty value.

@Capture Value
Code:
whileprintingrecords;
numberVar beg_qty := {table.beginning_qty_}
Now create a second formula to place in you group footer to display the variable you captured the beginning value in.

@Display Value
Code:
whileprintingrecords;
numberVar beg_qty;

~Brian
 
That just gives me zero value. The group header has no beginning qty.

Chris
IS Manager
 
When the group header is printing, it will have the values of the first record to be printed in that group. If you are getting a zero, it is because the first record in the group has a zero value for beginning qty.

~Brian
 
What makes it the "first" beginning quantity. Do you have a datefield that you could sort in descending order? Then you could just drag the beginning quantity field into the group footer to capture the value.

-LB
 
The first value is > 0 and it is sorted ascending in date order.

I did not know that the header contains the first record and the footer contains the last record.

I f--ked up. It worked great Brian. Thanks. You made this alot easier.

Chris
IS Manager
 
I have been facing a similar problem. This explains why I was not able to get the desired results.

Thank you everyone for this post :)

Kchaudhry
 
Ok I thought I would be able to get this fixed but seems like I still cant figure out why its not working. I have a formula @Override:

if
{measure_1.measure} = "Override Rollup"
then
{measure_1.performance}
else
0

When I place this formula in the group header I get zeros. When I place the same formula in the details section I get several records with first and last rows with zeros and some other rows with "1000".

I want to show "1000" in the group header. Can someone please guide me how to do this?

Thanks in advance.

Kchaudhry
 
Well, if you put the formula in your group header, what you would see in the group header would be the same as what is in the first detail section of that group.

What exactly are you trying to return? Are you trying to return the Maximum value? If so, just create a summary field off of your Override formula and place that in your Group Header, not the actual formula.

If your are not trying to return the Maximum value, then please give us more information. Indicate if it is the first value in the group, or the max value, etc.

~Brian
 
Brian,

Thanks for the reply. You are right that when I put the formula I am getting the first value in the detail section of that group, which is "0". I am trying to get the non zero value. In other words I want the formula to return me the record set which has an actual value instead of "0". I have checked the data and know that there is one record which has "1000" in it.

I am using CR 8.5 with SQL server 2000 backend.

Thanks for your help.

Kchaudhry
 
Create the summary I was referring to in my last post. The Maximum will always return the largest non zero value that is found, or it will return 0. That should solve your problem easily enough.

Insert, Summary.
Pick your formula as the field to summarize.
Pick Summary as the type.
Pick the apprpriate group field if you have more than one group.
Once you click ok, it will place it in the group footer.
You can just drag it to the group header to get it there.

~Brian
 
Ok, thanks that is working fine. Now is it possible to get a summary of all the max fields which have been created?

Appreciate all your help.

Kchaudhry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top