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     I need to create strange report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
I need to create strange report
 Login/Join
 
Gold member
posted
Hi All,

I have the following input data:

  
KEYS   COL1   COL2   COL3
---   ----   ----   ----
1      a1     b1     c1  
1      a2     b2     c2  
1      a3     b3     c3  
2      a4     b4     c4  
3      a5     b5     c5  
4      a6     b6     c6  
4      a7     b7     c7  



If the table contains more than one record per key the report should print something like HEADER and it should be printed only when the key is changed. That HEADER is consist of COL1+COL2(concatenate). After the HEADER is printed the report should print COL2+COL3 for all records per key.So far so good but when there is only one record per key I need to print only the HEADER.

Here is an example of the output:

 
a1b1           <- HEADER COL1+COL2
 b1c1          <- Line 1 COL2+COL3
 b2c2          <- Line 2 COL2+COL3  
 b3c3          <- Line 3 COL2+COL3  
a4b4           <- HEADER COL1+COL2  
a5b5           <- HEADER COL1+COL2
a6b6           <- HEADER COL1+COL2  
 b6c6          <- Line 6 COL2+COL3  
 b7c7          <- Line 7 COL2+COL3  



My idea was to use the HEADERS but when I have only one record per key that record should not be printed that means that I can use the HEADER.


Do you have any idea?


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
 
Posts: 72 | Registered: January 14, 2008Report This Post
Master
posted Hide Post
try this
SET ASNAMES = ON

DEFINE FILE FP1
ROWNUM/I9 = LAST ROWNUM + 1;
END

TABLE FILE FP1
SUM CNT.KEYS AS 'KEYCNT'
BY KEYS
PRINT
ROWNUM
COMPUTE HEADER/A5 = IF C1 GT 1 AND KEYS NE LAST KEYS THEN 'Y' ELSE 'N';
COMPUTE COLA/A10 = COL1 | COL2;
COMPUTE COLB/A10 = IF C1 EQ 1 THEN COL1 | COL2 ELSE COL2 | COL3 ;
BY KEYS
ON TABLE HOLD AS HOLD1
END

TABLE FILE HOLD1
PRINT COLB AS ''
BY ROWNUM NOPRINT
ON ROWNUM SUBHEAD
"<COLA "
WHEN HEADER EQ 'Y'
END





Scott

 
Posts: 865 | Registered: May 24, 2004Report 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     I need to create strange report

Copyright © 1996-2020 Information Builders