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     transforming columns to rows :) :)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
transforming columns to rows :) :)
 Login/Join
 
Silver Member
posted
Maybe anybody has some interesting ideas how to put few columns into one? Smiler

there is table:
--------------------------------
| ID | Name1 | Name2 | Name3 |
--------------------------------
| 1 | Ann | Merry | Lucy |
--------------------------------
| 2 | Natalie | Megan | Jill |
--------------------------------
...


What do you think? Is there a posibility to
transform this table and print those beautiful names in one column?

for instance transform and hold table to TRANSFORMED_DATA and then report:

TABLE FILE TRANSFORMED_DATA
PRINT MY_TRANSFORMED_DATA
WHERE ID EQ 1
END

the output should be :
-----------------------
| MY_TRANSFORMED_DATA |
-----------------------
| Ann |
-----------------------
| Merry |
-----------------------
| Lucy |
-----------------------

I have one wery cool way:

-*-----------------------------
TABLE FILE NAMES
PRINT NAME1 ID
ON TABLE HOLD AS N1
END
DEFINE FILE N1
MY_DATA/A40 = NAME1;
END
-*-----------------------------
TABLE FILE NAMES
PRINT NAME2 ID
ON TABLE HOLD AS N2
END
DEFINE FILE L2
MY_DATA/A40 = NAME2;
END
-*-----------------------------
TABLE FILE NAMES
PRINT NAME3 ID
ON TABLE HOLD AS N3
END
DEFINE FILE L3
MY_DATA/A40 = NAME3;
END
-*-----------------------------
MATCH
FILE N1
BY MY_DATA BY ID
RUN
FILE N2
BY MY_DATA BY ID
RUN
FILE N3
BY MY_DATA BY ID
AFTER MATCH HOLD AS MY_T_DATA OLD-OR-NEW
END
-*-----------------------------
TABLE FILE MY_T_DATA
PRINT MY_DATA
WHERE ID EQ 1
END
-*-----------------------------


But isn't it confusing??? Smiler Smiler


Any suggestions are welcome!!! Big Grin Smiler
 
Posts: 35 | Location: Vilnius, Lithuania | Registered: January 03, 2005Report This Post
Virtuoso
posted Hide Post
Something like this.

TABLE FILE NAMES
PRINT
ID AS ' ' OVER
NAME1 AS ' ' OVER
NAME2 AS ' ' OVER
NAME3
END
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
If you need to save the data in a hold file, try the following:

SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM
COUNTRY/A40 AS 'NAME'
BY COUNTRY NOPRINT
ON TABLE HOLD AS HOLD01
RUN
SUM
MODEL/A40 AS 'NAME'
BY MODEL NOPRINT
ON TABLE HOLD AS HOLD02
RUN
SUM
CAR/A40 AS 'NAME'
BY CAR NOPRINT
ON TABLE HOLD AS HOLD03
END

TABLE FILE HOLD01
SUM NAME
BY NAME NOPRINT
MORE
FILE HOLD02
MORE
FILE HOLD03
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 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     transforming columns to rows :) :)

Copyright © 1996-2020 Information Builders