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     Pivot row data in Column[issue closed]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Pivot row data in Column[issue closed]
 Login/Join
 
Member
posted
Hi,

we have requirement, we need to pivot the rows data in to column.
Our data is in the following format
colA ColB
A 01/01/2010
B 08/03/2010
C 04/02/2010
C 08/01/2010
A 04/01/2010
A 04/02/2010

and we want prepare the report in the below format
COLA JAN FEB MAR
A 2 1 0
B 0 0 1
C 1 1 0

we want to fetch all the records for the year and report it monthly for each item.

Thanks for your help in advance!

This message has been edited. Last edited by: NaviC,
 
Posts: 1 | Registered: June 18, 2010Report This Post
Master
posted Hide Post
DEFINE FILE yourfile
 JAN/D9 = IF yourdatfield FROM 20100101 TO 20100131 THEN 1 ELSE 0
 FEB/D9 = IF yourdatfield FROM 20100201 TO 20100228 THEN 1 ELSE 0
 MAR/D9 = IF yourdatfield FROM 20100301 TO 20100331 THEN 1 ELSE 0

....you get the point...
END


FILE TABLE yourfile
SUM JAN FEB MAR
BY COLA
ON TABLE PCHOLD FORMAT HTML
END



Even better is to use a function to retrieve the month from the date file ( depending on your date-format ).

This should do the trick....

G'luck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
You might convert your dates to the desired output format and use SUM ACROSS. This assumes ColB is a Smart Date.

DEFINE FILE filename
 MONTH_NUM/M   = ColB ;
 MONTH_ABBR/MT = ColB ;
END
-*
TABLE FILE filename
 SUM amount_field
 BY ColA
 ACROSS MONTH_NUM NOPRINT
 ACROSS MONTH_ABBR
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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     Pivot row data in Column[issue closed]

Copyright © 1996-2020 Information Builders