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] Convert rows to columns

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert rows to columns
 Login/Join
 
Member
posted
Please help to achieve the following output,

DB Data;
 
Class Type Value1 Value2 Value3 Value4
----- ---- ------ ------ ------ ------
C1    A    1      2      3      4
C1    B    4      3      2      1
C1    A    1      2      3      4
C1    B    4      3      2      1
 


Required Output;
 
Class Value1 A Value1 B Value2 A Value2 B Value3 A Value3 B Value4 A Value4 B
----- -------- -------- -------- -------- -------- -------- -------- --------
C1    2        8        4        6        6        4        8        2
 

This message has been edited. Last edited by: Kathleen Butler,
 
Posts: 2 | Registered: September 09, 2015Report This Post
Guru
posted Hide Post
COMPUTE or DEFINE can handle that.

I saw in the past one post about converting columns to rows. Maybe if you find it you can do something similar.


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
This should be close to what you want, but sorts all of the "A" Types first.

...
SUM Value1 Value2 Value3 Value4
BY Class
ACROSS Type
...

If you want the columns in the exact order displayed, then you will likely need to use DEFINEs or COMPUTEs to create a bucket for each Type and Value combination.


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

DEFINE FILE YOUR_FILE
V1_A/I03 = IF TYPE EQ 'A' THEN VALUE1 ELSE 0;
V1_B/I03 = IF TYPE EQ 'B' THEN VALUE1 ELSE 0;
V2_A/I03 = IF TYPE EQ 'A' THEN VALUE2 ELSE 0;
V2_B/I03 = IF TYPE EQ 'B' THEN VALUE2 ELSE 0;
V3_A/I03 = IF TYPE EQ 'A' THEN VALUE3 ELSE 0;
V3_B/I03 = IF TYPE EQ 'B' THEN VALUE3 ELSE 0;
V4_A/I03 = IF TYPE EQ 'A' THEN VALUE4 ELSE 0;
V4_B/I03 = IF TYPE EQ 'B' THEN VALUE4 ELSE 0;
END
-*
TABLE FILE YOUR_FILE
SUM
V1_A
V1_B
V2_A
V2_B
V3_A
V3_B
V4_A
V4_B
BY CLASS
END


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Member
posted Hide Post
Thanks Ricardo & Dan.

Thanks Jim, it works.
 
Posts: 2 | Registered: September 09, 2015Report 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] Convert rows to columns

Copyright © 1996-2020 Information Builders