Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to return only 1 record/row based on column/field values?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to return only 1 record/row based on column/field values?
 Login/Join
 
Member
posted
I have one Table. This Table has multiple identical ID#s (Rows/Records).
Each ID Record/Row has an Effective Sequence field/column(Integer) and a
EffectiveDate field/column (YYMD). [Same ID, Different Column/Field Values)

I want to filter/select/return only the row/record for an ID
with the Max/Highest Effective Sequence number(Integer) column and
Max/Highest EffDate (Date) column for that ID (record).

The Report Result/Output is only 1/unique Row/Record (ID Column) value with the
highest highest value for EffSequence and EffDate.

Here is the Output/Report Column Format:

ID Eff.Sequence Eff.Date TypeCount

Any assistance will be appreciated.

Thanks

This message has been edited. Last edited by: motto,


WebFocus Developer 7.6.10
 
Posts: 13 | Registered: November 16, 2009Report This Post
Virtuoso
posted Hide Post
Try this:

TABLE FILE <tablename>
SUM MAX.EffSequence
    MAX.EffDate
    CNT.ID AS 'TypeCount'
 BY ID
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
Dan,

Your response was very helpful. It answered my question on filtering ID BY MAX.FLD in a Record.

I didn't want to close this question out immediately. Since I knew, I'd have a very similiar related question.

I am doing a GENDER COUNT as an ACROSS FIELD.

However there are duplicate-mulitiple IDs in the BY (Record).

How do I filter out duplicate IDs or just COUNT 1 ID (MULITPLE RECORDS w SAME ID)?

TABLE FILE STDNT_ENRL
SUM
'CNT.STDNT_ENRL.EMPLID'
ACROSS 'J0.PERSONAL_DATA.SEX'
HEADING
""
FOOTING
""
WHERE (STDNT_ENRL.INSTITUTION EQ 'INSTI' ) AND ( STDNT_ENRL.STRM EQ '1108' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON

This is Current HTML OUTPUT

Sex
F M U

--------------------------------------------------------------------------------

3035 1867 6

The PRINT values count/contains multiple IDS

Any help would be appreciated.

Thanks

Mike


WebFocus Developer 7.6.10
 
Posts: 13 | Registered: November 16, 2009Report This Post
Virtuoso
posted Hide Post
This may require a two step solution:

TABLEF FILE STDNT_ENRL
 COUNT DST.STDNT_ENRL.EMPLID
 BY J0.PERSONAL_DATA.SEX
 WHERE (STDNT_ENRL.INSTITUTION EQ 'INSTI') AND ( STDNT_ENRL.STRM EQ '1108');
 ON TABLE HOLD
END
-*
TABLE FILE HOLD
 SUM EMPLID
 ACROSS SEX
 HEADING
  ""
 FOOTING
  ""
 ON TABLE SET PAGE-NUM OFF 
 ON TABLE NOTOTAL
 ON TABLE PCHOLD FORMAT HTML
 ON TABLE SET HTMLCSS ON 
 .
 .
 .
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
Dan,

You can close this Question & Thread Out.

It was helpful. The first part, particulalry.

Thanks

Mike


WebFocus Developer 7.6.10
 
Posts: 13 | Registered: November 16, 2009Report This Post
Virtuoso
posted Hide Post
Mike, actually it is you who can close it Cool . Just edit your first post and edit the title prefixing it with [CLOSED].



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to return only 1 record/row based on column/field values?

Copyright © 1996-2020 Information Builders