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

To find corresponding value of a formula filed

Status
Not open for further replies.

mravimtnl

MIS
Nov 1, 2009
47
Dear all

I have the follwoing table thru which i am finding minimum time of enty.

Badge number time stamp Panel Name
2465 9. am Main Gate 1 Entry
2465 10. am LPG Gate 1 EXIT
2465 10.40. am TurnstGate 1 2467 10.40. am TurnstGate 1 Entry

I am taking minimum entry ( min of time stamp grouped by badge number) using formula whic i am getting correctly. But I am not able to get the corresponding panle name.

For example in the above case the entry time is shown as 9 am but correponding panle entry is shown as Turnstile gate entry 1. Pls susggest how can gate correponding panel name
 
Please show your current formula. Also note that you appear to be showing the maximum time, not the minimum for your result. Is the time stamp field of time datatype or is it a string? If you browse the field, what is the identified datatype?

-LB
 
Minimum(time stamp,Badge number) is my formula. The time filed is in time format not a string.
 
Where do you want to show the results? In what report section?

-LB
 
In group footer 1 that is the minimum time is grouped with badge number (Which is group 1) and I want panel name adjacent to the time.
 
Create these formulas:

//{@accum} for the detail section (suppress):
whileprintingrecords;
stringvar pan;
if {table.time} = minimum({table.time},{table.badge}) then
pan := {table.panelname};

//{@display} for GF:
whileprintingrecords;
stringvar pan;

-LB
 
I have a very similar situation. I have a number, date, operations counter and I want to put the operations counter value in the group footer based on the maximum date in the group. I have the report returning all the dates and values in the group then printing the maximum date in the group footer, but I am not sure how to get the cooresponding operations counter value displayed int he group footer as well. Can you assist with this? I am new to crystal reports and am not sure where to try and put the recommended equations listed in this thread. your help would be greatly appreciated.

FYI i simply did a summary in the group footer to find the maximum date value. now just need to return the corresponding value for operations counter.
 
Create a formula like this:

whileprintingrecords;
numbervar y;
if {table.date} = maximum({table.date},{table.group}) then
y := {@yourcounterhere};

In the group footer, use:

whileprintingrecords;
numbervar y;

Add a reset to the group header:

whileprintingrecords;
numbervar y;
if not inrepeatedgroupheader then
y := 0;

-LB
 
THanks!!! That worked great!!

Another question to build on this... How do I look up the 2nd maximum date then retrieve the associated counter value. Then do a calculation to determien the difference between max counter and 2nd max counter??
 
It is best to lay out the entire question up front instead of tacking additional requirements on one at a time--especially since it might change the nature of suggested solutions. YOu can use a variable as in the first case, using a different name, and but substitute "Nthlargest(2,{table.date},{table.group})" for the maximum function.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top