[SOLVED] remove duplicate records or filter for Max? Last? DS 7.7.03
Using WebFocus Developer Studio 7.7.03 - Excel 2007 output
I am working within one table (no joins) and I am receiving duplicate records by account number because there are multiple steps completed and captured. How do I return only one record per account number, showing only the maximum or using the LAST function so I can sort the completions in order and say if the last account isn't a duplicate, define as keep, else dup.
The sequence number is really the key. The step name is not sequencial, they jump around a bit. Like in account #2, it's possible for 2 steps to be completed on the same day, but the sequencer determines which supercedes.
Thanks Tom! That seemed to do the trick. I'm not a coder, and I've never looked at the source before, so I just threw it in there and it worked. Thanks again for the quick response.
wFDS: 7.7.03, OS: Windows, Output: Mostly Excel
November 16, 2012, 04:22 PM
Crymsyn
Although you have a way, another is to do a BY HIGHEST 1 on SEQUENCE and as long as there are no duplicate Sequence numbers it should work the same with PRINT or SUM.
SUM
STEP_STEP
COMP_DATE
BY ACCOUNT
BY HIGHEST 1 SEQUENCE
WF: 8201, OS: Windows, Output: HTML, PDF, Excel
November 19, 2012, 09:42 AM
reportmasterlvl3
Thanks for your contribution, Crymsyn! There are no duplicate sequence numbers, so this method works as well, and is actually more simple and my query runs faster. Awesome! Thanks again.This message has been edited. Last edited by: reportmasterlvl3,