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     [SOLVED] Issue with LAST function.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Issue with LAST function.
 Login/Join
 
Member
posted
Hi,

We have a requirement in the report to display a concatenated stirng of PERSON_IDs(say P_ID).
This I am generating in DEFINE. P_ID is based on ISSUE_ID(say I_ID) and AUTHER_ID(A_ID).

The data is something like : --

P_ID I_ID A_ID
---- ----- -----
P1 800 1
P2 800 1
P2 800 3

The code I've return is

DEFINE HOLD_DUMMY
P_ID_STRING/A1000V = IF (I_ID EQ LAST I_ID) AND (P_ID NE LAST P_ID) THEN LAST P_ID_STRING|(P_ID||'@ ; ') ELSE P_ID||'@ ; ';
END

The result I am getting is : P2@;

Expected result : P1@;P2@;

Please let me know if you have any solution.

Thanks.

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


764
Windows
PDF,EXL2K,HTML
 
Posts: 27 | Registered: July 28, 2009Report This Post
Virtuoso
posted Hide Post
Try:

P_ID_STRING/A1000V = IF (I_ID NE LAST I_ID) OR (P_ID NE LAST P_ID) THEN P_ID||'@ ; ' ELSE LAST P_ID_STRING|(P_ID||'@ ; ');


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Virtuoso
posted Hide Post
Using the CAR file:
  
-* File lalita01.fex
TABLE FILE CAR
PRINT CAR SEATS
BY COUNTRY
ON TABLE HOLD
END
DEFINE FILE HOLD
C_STRING/A1000V = IF (COUNTRY NE LAST COUNTRY) THEN CAR || '@;'
                  ELSE IF (CAR NE LAST CAR) THEN LAST C_STRING | (CAR || '@;') ELSE LAST C_STRING;
END
TABLE FILE HOLD
PRINT CAR COUNTRY SEATS C_STRING
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
Hi Danny -- you logic worked perfectly. Thanks a lot !!


764
Windows
PDF,EXL2K,HTML
 
Posts: 27 | Registered: July 28, 2009Report This Post
Expert
posted Hide Post
Using LAST within a define requires that the input file is in the exact sort order that your code logic requires. If this is not the case then you would be better served doing the new field via a COMPUTE within you code.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Tony,

Very true! Wink


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
quote:
Very true!

Thanks Danny, that's why I mentioned it Razzer

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
quote:
Using LAST within a define requires that the input file is in the exact sort order that your code logic requires. If this is not the case then you would be better served doing the new field via a COMPUTE within you code.


Very true indeed! Lalita, just keep in mind that, if you use the COMPUTE approach, you'll be using a PRINT verb and *not* a SUM, otherwise it won't work as you might expect.



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     [SOLVED] Issue with LAST function.

Copyright © 1996-2020 Information Builders