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]how to create 2 columns of data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]how to create 2 columns of data
 Login/Join
 
Member
posted
Thanks everyone for your help! I tried to use the "mailing label" approach but when I started to add my header/footer that fell apart. So what I decided to do was create a hold file for the row/column data, a row for the header data and a row for the footer data. Then I used MATCH logic to put them all together in one big HOLD file. Since this report is only going after one student at a time, I don't have to worry about response time.

This message has been edited. Last edited by: gmb,


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Master
posted Hide Post
I find it a bit hard to understand what you're trying.

But if I get it correctly you might be better of using a DEFINE instead of ACROSS.

Like
DEFINE holdfile1
CNTR1/D4 = IF CNTR EQ 1 THEN the_data ELSE 0;
CNTR2/D4 = IF CNTR EQ 2 THEN the_data ELSE 0;
etc...
END

or a MATCH... ( we use this a lot )

MATCH FILE holdfile1
PRINT
the_data AS 'the_data1'
the_other AS 'the_other1'
the_next AS 'the_next1'
BY WHATEVER1
BY WHATEVER2
WHERE CNTR EQ 1;
RUN
FILE holdfile1
PRINT
the_data AS 'the_data2'
the_other AS 'the_other2'
the_next AS 'the_next2'
BY WHATEVER1
BY WHATEVER2
WHERE CNTR EQ 2;
AFTER MATCH HOLD OLD-OR-NEW
etc.


Anyway. Really create seperate columns instead of using ACROSS.

Or perhaps use
ACROSS COLUMNS 1 AND 2 AND 3 AND 4 .....

( check DevStudio's Help, search for "ACROSS COLUMNS AND" )


If the number of across-values is limited...
G'luck !


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Thanks Dave, I'm trying to create two columns of data. Think about mainframe reports, how the data is parsed into two columns. My example didn't print as I thought it would so I will try again.

This is column 1 This is column 2
school_a term Q1 high school 12 course1 school_a term Q2 high school 12 course1
course2 course53
school_a term Q3 high school 12 course2 school_b term 5 summer school 8 course4
course8 course3
school_c term 5 summer school course22
course44
I won't know how many ROWS of data each column will have. Basically this is a School Transcript Report. So you could have grades K-12 or you may just have Grades 9-12 on your transcript. I have tried the ACROSS command and like I mentioned above it's doing the split with the first column on the first set of rows and then the second column on the next set of rows.


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Member
posted Hide Post
I can't seem to get my spacing to hold when I type my request in. But the second column starts with school_a_term. So let me see if I can describe it this way.

This is column 1 data
school_a term Q1 high school 12 course1
Course4
This is column 2 data
school_a term Q2 high school 12 course1
course53
This is column 1 data
school_a term Q3 high school 12 course2
course8
This is column 2 data
school_b term 5 summer school 8 course4
course3


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Expert
posted Hide Post
To ensure multiple blanks are not squeezed down to one, use the
[code]
[/code]
tags around the report output (achieved by clicking on </>)

I can't figure out what you'd like your output to look like.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
<html>
<body>
<table border=1>
<tr align=center>
<td>[b]Column - 1 Title[/b]</td>
<td>[b]Column - 2 Title[/b]</td>
</tr>
<tr>
<td>school_a term Q1 high school 12 course1 Course4</td>
<td>school_a term Q2 high school 12 course1 course53</td>
</tr>
<tr>
<td>school_a term Q3 high school 12 course2 course8</td>
<td>school_b term 5 summer school 8 course4 course3</td>
</tr>
</table>
</body>
</html>


Are you looking something like this?
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Master
posted Hide Post
Are you looking something similar to this.

SET ACROSSPRT=COMPRESS

TABLE FILE CAR
SUM
SALES
RETAIL_COST
DEALER_COST
BY CAR
-*In your case sort by Quarter
ON TABLE HOLD
END
DEFINE FILE HOLD
CNTR/I1=IF CAR EQ LAST CAR THEN CNTR ELSE CNTR+1;
-*Instead of CAR test the above expression with Quarter
CNTR_1/I3 = IMOD(CNTR, 2, CNTR_1);
END
TABLE FILE HOLD
PRINT
CAR AS 'Car'
SALES AS 'Sales'
RETAIL_COST AS 'Retail Cost'
DEALER_COST AS 'Dealer Cost'
COMPUTE AA/A2=''; AS ''
ACROSS CNTR_1 NOPRINT 
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, ORIENTATION=LANDSCAPE,PAGESIZE=LEGAL, SQUEEZE=ON, $
TYPE=DATA, ACROSSCOLUMN=CAR, STYLE=BOLD, $
TYPE=TITLE, STYLE=BOLD, $
ENDSTYLE
END
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Member
posted Hide Post
 This is column 1 
                 This is column 2 

 school a term Q1 high school 12 course1 
 school a term Q2 high school 12 course1 
                                 course2 
                                 course53

 school a term Q3 high school 12 course2 
 school b term 5 summer school 8 course4 
                                course8  
                                 course3 

 school c term 5 summer school course22  

                               course44 


Hopefully this will display correctly!!


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Member
posted Hide Post
 highschool term Q1 
 highschool term Q2 

 highschool term Q3 
 Middle School term 5 

 summer school 5 


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Member
posted Hide Post
Well I can't get this to display correctly. But in the last post you can see that I have highschool term Q1 (that is column 1) highschool term Q2 (column 2) then on the next row, highschool term Q3 (column 1) middle school term 5 (column 2) next row, summer school 5 (column 1). Sorry I can't get this silly thing to display correctly. Hopefully someone can see what I'm trying to build. I'm trying to use the technique that creates mailing labels. But if anyone else has another idea I would love to hear it!


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Member
posted Hide Post
Ram, You are close, but unfortunately the sort fields are Schoolyear, School, Term, Grade. When I go across CNTR then I get the rows staggered by the above mentioned sort fields.


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Master
posted Hide Post
LOL Roll Eyes

So if I understand it right...

Follow Ram's sample.

But use a smarter DEFINE to suit your BY's
DEFINE FILE HOLD
CNTR/I1=IF ( SCHOOLYEAR EQ LAST SCHOOLYEAR ) AND ( SCHOOL EQ LAST SCHOOL ) AND ( TERM EQ LAST TERM ) AND ( GRADE EQ LAST GRADE ) THEN CNTR ELSE CNTR+1;
CNTR_1/I3 = IMOD(CNTR, 2, CNTR_1);
END


In this case the CNTR will only 'flip' when all your BY fields are the same as the ones on the LAST row...

hope this works...


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Dave, I wish it were that easy! The rub here is that the customer doesn't care if these sort values are the same or not. They want each "block" of data to go across the page, in 2 columns. So I could have HighSchool Q1 and then next column HighSchool Q2, next row would be HighSchool Q3 and then column two may be MiddleSchool Term 1. You can see that the sort fields wouldn't not be the same.


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Virtuoso
posted Hide Post
Small example using the car file:
DEFINE FILE CAR
COLNR/I4 WITH MODEL = IF COLNR EQ 2 THEN 1 ELSE 2;
ROWNR/I4 WITH MODEL = IF COLNR EQ 2 THEN ROWNR + 1 ELSE ROWNR;
EMPTY/A4 WITH MODEL = ' ';
END
TABLE FILE CAR
SUM COUNTRY AS ''
OVER CAR AS ''
OVER MODEL AS ''
OVER EMPTY AS ''
BY ROWNR NOPRINT
ACROSS COLNR NOPRINT
END
Does this help you in any way?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Thanks GamP, that is what I was just working with. I created a row_cntr and col_cntr in a hold file then used those for my by/across. Now I'm trying to get all the headings and footings in the way they want to see them!


WF 8.1.0.5
Windows, Unix, MVS
HTML, PDF, PPT, EXCEL, USER, FOCUS
 
Posts: 10 | Registered: April 14, 2009Report This Post
Expert
posted Hide Post
Do you think "multi-pane pages" would help?

Documentation: Creating Reports With WebFOCUS Language > Laying Out the Report Page > Working With Mailing Labels and Multi-Pane Pages


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
quote:
[TYPE=REPORT,] PAGEMATRIX=(c r), ELEMENT=(w h), [GUTTER=(x y),]
[MATRIXORDER={VERTICAL|HORIZONTAL},] [LABELPROMPT={OFF|ON},] $

Thanks Francis. I am not aware of this options before.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report 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]how to create 2 columns of data

Copyright © 1996-2020 Information Builders