Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Suppress all but newest record
Go
New
Search
Notify
Tools
Reply
  
Suppress all but newest record
 Login/Join
 
Member
posted
I am reporting off of a table that holds records (events) of unit movements. Units move several times a day. The report I am building will show all units, sorted by location, but I only want to show each unit once, by it's newest movement record. Fields are: unit, location, date, time, owner. The preferred format would be:

Unit Location Owner Date Time
UnitB - New York - Bill - 06/13/04 - 2103
UnitD - New York - Jean - 06/13/04 - 2200
UnitC - Chicago - Roy - 06/12/04 - 1535
UnitA - KanCity - Jim - 06/13/04 - 2040

In reality, UnitB has 5 other movement records, all older than 06/13/04 2103 hours. Does anyone out there have a suggestion on how to do this?
 
Posts: 9 | Location: Topeka | Registered: June 13, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
you might want to try

BY UNIT
...
BY HIGHEST 1 TIME

hth,

drew
 
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003Reply With QuoteReport This Post
Member
posted Hide Post
Drew:

Thanks for the suggestion. I have already tried that and it doesn't suppress the duplicates. I think if you have three movement records all showing the same date and time for a unit (it's possible) and those three records are newer than all the others, it outputs the line 3 times.
 
Posts: 9 | Location: Topeka | Registered: June 13, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Yes, I checked the data and that is exactly what it is doing. Even though I am telling it to report the highest (1) date and highest (1) time for the unit, it grabs all of them if they are the same...
 
Posts: 9 | Location: Topeka | Registered: June 13, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
in that case you might want to try something like:

-* concat a unique key, you may have to convert your date and time to an alpha or whatever
DEFINE FILE yyy
U_KEY/A99 = LOCATION | USER | ... other fields ;
END

TABLE ...

BY HIGHEST 1 U_KEY


hth,

drew
 
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003Reply With QuoteReport This Post
Silver Member
posted Hide Post
or you might even want to look at something like

WHERE LOCATION NE LAST LOCATION AND
USER NE LAST USER AND
DATE NE LAST DATE AND
TIME NE LAST TIME;

just an idea,

drew
 
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Mulder,
use the lst. prefix operator
assuming you have sorted your file so that the latest date is the bottom of each unit paragraph
SUM LST.OWNER LST.DATE LST.TIME BY UNIT BY LOCATION

works like a charm

umm. can we expect a Scully, from your same org? Razzer
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Member
posted Hide Post
Susannah:

My counterpart is not the right gender. Big Grin
 
Posts: 9 | Location: Topeka | Registered: June 13, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Suppress all but newest record

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.