IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Converting rows to columns
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
HI ,
I have searched thru the columns and found columns to rows conversion , but not the other way.
I have a table that has following value

id rank number
1 A 1001
1 B 1002
1 C 1003
2 A 1004
2 B 1005

I need to convert it to

id rank 'A' rank 'B'
1 1001 1004
2 1002 1005


Does anyone have any suggestions. I tried using define but could not eliminate extra rows that come with for example rank C.


Developer Studio Version 7.1.4
Windows Platform
 
Posts: 27 | Location: Michigan | Registered: January 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Wouldn't

TABLE FILE ...
SUM NUMBER
BY ID
ACROSS RANK
END

do the job?


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
NO,
I need to be able to identify the across column.
its part of a bigger problem.


Developer Studio Version 7.1.4
Windows Platform
 
Posts: 27 | Location: Michigan | Registered: January 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Here is my code
JOIN LIKP_VBELN IN LIKP TO MULTIPLE LIPS_VBELN IN LIPS AS J0
JOIN LIPS_VBELN IN LIKP TO VBUK_VBELN IN VBUK AS J1
JOIN LIPS_VGBEL IN LIKP TO VBAK_VBELN IN VBAK AS J2
JOIN VBAK_VBELN IN LIKP TO MULTIPLE VBPA_VBELN IN VBPA AS J3

DEFINE FILE LIKP
SHIPTO/A100 = IF VBPA_PARVW EQ 'WE' THEN VBPA_KUNNR ELSE '';
CARRIER/A100 = IF VBPA_PARVW EQ 'TU' THEN VBPA_LIFNR ELSE '';
END
TABLE FILE LIKP
PRINT
SHIPTO
CARRIER
BY VBPA_VBELN
WHERE VBUK_WBSTK = 'C'
AND VBPA_VBELN = '0000000051'
AND LIKP_WADAT FROM '20050101' TO '20070501'
END

and my output looks like

SD Doc. SHIPTO CARRIER
51......................
..........................
..........................
..........................700001
..........1000007



but I need

SD Doc. SHIPTO CARRIER
51 1000007 700001


The blank spaces occur because VBPA_PARVW has other values. If I do a sum instead of print, I am getting blanks.

SD Doc. SHIPTO CARRIER
51


Developer Studio Version 7.1.4
Windows Platform
 
Posts: 27 | Location: Michigan | Registered: January 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Would

 
SUM
MAX.SHIPTO
MAX.CARRIER
BY VBPA_VBELN  


work to remove your blank spaces?

Kevin


WF 7.1.3 / WIN-AIX
 
Posts: 137 | Location: Denver, CO | Registered: December 09, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
How do you know that SHIPTO 1000007 and CARRIER 700001 belong to SD Doc. 51?


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Ok, Max. did it.,that was easy. thanks Kevin.
Thanks Francis too for enquiring into this.


Developer Studio Version 7.1.4
Windows Platform
 
Posts: 27 | Location: Michigan | Registered: January 22, 2007Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Converting rows to columns

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.