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     Modifying Columns To Rows

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Modifying Columns To Rows
 Login/Join
 
Silver Member
posted
I was wondering what would be the easiest way to take columns and pivot them into rows in the Report Builder in Developer Studio? Below is an example of the issue:

Year Period1 Period2 Period3 Period4
----- -------- -------- -------- --------
2016 456,123 789,456 123,456 456,789

Change above to below...

Year Period Values
------ ------- -------
2016 Period1 456,123
2016 Period2 789,456
2016 Period3 123,456
2016 Period4 456,789


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
If the source data is a flat file, you can create an alternate master and put a segment with OCCURS in it.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Silver Member
posted Hide Post
Not a flat file. DB2 source.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Master
posted Hide Post
TABLE FILE
PRINT
YEAR
PERIODE1 AS 'PERIODE'
VALUE
ON TABLE HOLD AS H01
END

TABLE FILE
PRINT
YEAR
PERIODE2 AS 'PERIODE'
VALUE
ON TABLE HOLD AS H02
END

TABLE FILE
PRINT
YEAR
PERIODE3 AS 'PERIODE'
VALUE
ON TABLE HOLD AS H03
END

TABLE FILE
PRINT
YEAR
PERIODE4 AS 'PERIODE'
VALUE
ON TABLE HOLD AS H04
END

TABLE FILE H01
PRINT YEAR PERIODE VALUE
ON TABLE PCHOLD FORMAT HTML ( or whatever you want )
MORE
FILE H02
MORE
FILE H03
MORE
FILE H04
END

...

if you need more, you might consider creating a loop.

Good luck,


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Expert
posted Hide Post
Using one of the sample files (in this case GGSALES) -

DEFINE FILE GGSALES
  MONTH/M = DATE;
  YEAR/YY = DATE;
  Period1/D12C = IF MONTH FROM  1 TO  3 THEN DOLLARS ELSE 0;
  Period2/D12C = IF MONTH FROM  4 TO  6 THEN DOLLARS ELSE 0;
  Period3/D12C = IF MONTH FROM  7 TO  9 THEN DOLLARS ELSE 0;
  Period4/D12C = IF MONTH FROM 10 TO 12 THEN DOLLARS ELSE 0;
END
TABLE FILE GGSALES
  SUM YEAR AS '' Period1 AS 'Period1'
 OVER YEAR AS '' Period2 AS 'Period2'
 OVER YEAR AS '' Period3 AS 'Period3'
 OVER YEAR AS '' Period4 AS 'Period4'
   BY YEAR NOPRINT
WHERE YEAR EQ 1996
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  grid=off, $
ENDSTYLE
END

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
RMM,
You can still use the alternate master technique if you don't mind a HOLD:
  
-* File rmm01.fex
-* Hold the data and create fields for the names of the periods
TABLE FILE ttt
PRINT
YEAR
Period1
COMPUTE P1/A8='Period1';
Period2
COMPUTE P2/A8='Period2';
Period3
COMPUTE P3/A8='Period3';
Period4
COMPUTE P4/A8='Period4';
ON TABLE HOLD AS RMM FORMAT ALPHA
END
-RUN
-*Create an alternate master in memory
EX -LINES 7 EDAPUT MASTER,RMM,C,MEM
FILENAME=RMM, SUFFIX=FIX
SEGNAME=RMM, SEGTYPE=S0
FIELDNAME=YEAR, FORMAT=YY, ACTUAL=A4, $
SEGNAME=P, PARENT=RMM, OCCURS=VARIABLE
FIELDNAME=VALUES, FORMAT=D6, ACTUAL=A6, $
FIELDNAME=PERIOD, FORMAT=A8, ACTUAL=A8, $
-RUN
-* Produce the output
TABLE FILE RMM
PRINT YEAR PERIOD VALUES
END

I don't know the formats of Year and Period1..4. I did some assumptions.


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
Gold member
posted Hide Post
I realize this is minimally helpful, but I remember seeing something at the last WebFOCUS user group where you are able to use ACROSS vertically.

So if you did:
BY YEAR
ACROSS PERIOD

Then whatever you have to set to change ACROSS to act vertically should do it... I'm not able to find my notes on that.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report 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     Modifying Columns To Rows

Copyright © 1996-2020 Information Builders