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] Format related data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Format related data
 Login/Join
 
Gold member
posted
Hi,

I'm unsure how to get data in a table from one 'format' (rows) to related columns using FOCUS.
To illustrate what I need:

I have a table with the following data:
comp SuperComp
1 1
4 1
4 4
10 4
11 11
12 11

I need all related items to be next to each other in columns. so, 1 is related to 4 and 4 is related to 10 - the output I need is then:

NewComp1 NewComp2 NewComp3
1 4 10
11 12 .

I have tried every way I can think of to get the data in this format with no luck. Any ideas would be most appreciated!

Jinx.

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


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report This Post
Virtuoso
posted Hide Post
Two caveats:
1. This code assumes the data is already sorted by columns SUPERCOMP and COMP.
2. Data relationships had to be assumed based on the data provided, since the relationships were not really explained.

APP FILEDEF TESTMAS DISK testdata.mas
-RUN
-WRITE TESTMAS FILENAME=TESTDATA,SUFFIX=FIX
-WRITE TESTMAS SEGNAME=TESTDATA,SEGTYPE=S0
-WRITE TESTMAS FIELDNAME=COMP      ,ALIAS=COMP      ,FORMAT=I2 ,ACTUAL=A2 ,$
-WRITE TESTMAS FIELDNAME=SUPERCOMP ,ALIAS=SUPERCOMP ,FORMAT=I2 ,ACTUAL=A2 ,$
-*
APP FILEDEF TESTDATA DISK testdata.ftm
-RUN
-WRITE TESTDATA 0101
-WRITE TESTDATA 0401
-WRITE TESTDATA 0404
-WRITE TESTDATA 1004
-WRITE TESTDATA 1111
-WRITE TESTDATA 1211
-RUN
-*
DEFINE FILE TESTDATA
 BYSORT    /I2 = IF SUPERCOMP NE LAST SUPERCOMP AND SUPERCOMP NE LAST COMP THEN (BYSORT + 1) ELSE BYSORT ;
 ACROSSSORT/I2 = IF BYSORT NE LAST BYSORT THEN 1 ELSE IF COMP NE LAST COMP THEN (ACROSSSORT + 1) ELSE ACROSSSORT ;
END
-*
TABLE FILE TESTDATA
 SUM    FST.COMP
 BY     BYSORT     NOPRINT
 ACROSS ACROSSSORT NOPRINT
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thanks for the suggestion. It does help me somewhat.

Jinx.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report 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] Format related data

Copyright © 1996-2020 Information Builders