Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Apply Across for selective columns
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Apply Across for selective columns
 Login/Join
 
Member
posted
Hi All,

I have a report with 7 columns and 1 by field, I would like to apply across for last 2 columns only. Across field is a month/year field. Is it possible to apply across only for selective columns? Thank you very much in advance.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
Can you give an example, say with one of the sample files like CAR ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Hi Waz,

Thanks for taking time, This is how my output should look like, If I am creating report on car file

country car model bodytype seats Jan Feb Mar


dealer_cost retailer_cost dealer_cost retailer_cost dealer_cost retailer_cost

So, basically dealer_cost and retailer_cost should be available as split columns under each month(column) seperate

Car file code is like
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
BODYTYPE
SEATS
DEALER_COST
RETAIL_COST
BY COUNTRY
END
My actual code is like

TABLE FILE TABLENAME
SUM
SALES1
SALES2
SALES3
SALES4
SALES5
SALES6
SALES7
BY SORT1
END
ACROSS column would be month field.
Please let me know if i am making any sense.
Regards
Leela krishna

This message has been edited. Last edited by: Leela Krishna,


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
Is it more like this ?

TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR 
BY MODEL
BY BODYTYPE
ACROSS SEATS
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
... or more like this:
  
-SET &ECHO=ALL;
-* File leela01.fex
DEFINE FILE CAR
SALES1/I6=SALES * RDUNIF('D4.2');
SALES2/I6=SALES * RDUNIF('D4.2');
SALES3/I6=SALES * RDUNIF('D4.2');
SALES4/I6=SALES * RDUNIF('D4.2');
END
TABLE FILE CAR
SUM
SALES
SALES1
SALES2
SALES3
SALES4
BY COUNTRY
SUM
RCOST
DCOST
BY COUNTRY
ACROSS SEATS
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Waz,
sorry for delay in response, It was more like this
TABLE FILE CAR
SUM
SALES
SALES1
SALES2
SALES3
SALES4
SALES5
SALES6
SALES7
BY COUNTRY
END

I wanted to put an across by month, and I did it the way Danny-SRL mentioned in the next post. but I see month names one line above the columns
COUNTRY,SALES1,SALES2,SALES3,SALES4,SALES5,SALES6,SALES7. I want to display them beside like this SALES1,SALES2,SALES3,SALES4,SALES5,JAN, FEB, MAR,APRIL. whereas SALES6,SALES7 should be displayed below each and every month. please let me know if there is way to achieve this? I am I making sense Smiler


quote:
Originally posted by Waz:
Is it more like this ?

TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR 
BY MODEL
BY BODYTYPE
ACROSS SEATS
END


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Member
posted Hide Post
Danny-SRL,

Thanks for taking time to respond, Yes, I did it the same way, but I see month names one line above the columns
COUNTRY,SALES1,SALES2,SALES3,SALES4,SALES5,SALES6,SALES7. I want to display them beside like this SALES1,SALES2,SALES3,SALES4,SALES5,JAN, FEB, MAR,APRIL. whereas SALES6,SALES7 should be displayed below each and every month. Is there a way to do this?

quote:
Originally posted by Danny-SRL:
... or more like this:
  
-SET &ECHO=ALL;
-* File leela01.fex
DEFINE FILE CAR
SALES1/I6=SALES * RDUNIF('D4.2');
SALES2/I6=SALES * RDUNIF('D4.2');
SALES3/I6=SALES * RDUNIF('D4.2');
SALES4/I6=SALES * RDUNIF('D4.2');
END
TABLE FILE CAR
SUM
SALES
SALES1
SALES2
SALES3
SALES4
BY COUNTRY
SUM
RCOST
DCOST
BY COUNTRY
ACROSS SEATS
END


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
Danny basically had it.

With a couple of changes, assuming I understand your requirements.

DEFINE FILE CAR
SALES1/I6=SALES * RDUNIF('D4.2');
SALES2/I6=SALES * RDUNIF('D4.2');
SALES3/I6=SALES * RDUNIF('D4.2');
SALES4/I6=SALES * RDUNIF('D4.2');
MONTH/Mt = SEATS ;
END
TABLE FILE CAR
SUM
SALES
SALES1
SALES2
SALES3
SALES4
BY COUNTRY
SUM
RCOST AS SALES6
DCOST AS SALES7
BY COUNTRY
ACROSS MONTH
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
I was able to put an across but I wanted to display across field(MONTH) beside other columns, not on top.
Is there a way to do it?


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi Leela,

Look at ACROSSTITLE=SIDE, you will find several posts on how to use this.

A small example would be following:
SET ACROSSTITLE=SIDE
TABLE FILE CAR
SUM
SALES AS ''
BY COUNTRY AS ''
ACROSS SEATS AS 'COUNTRY'
END  


And you would have to add styling to make the country title left-adjusted.

Martin.


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 154 | Registered: March 29, 2013Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Leela,
Is this what you want, or do you need a second line of titles?
  
-SET &ECHO=ALL;
-* File leela01.fex
DEFINE FILE CAR
SALES1/I6=SALES * RDUNIF('D4.2');
SALES2/I6=SALES * RDUNIF('D4.2');
SALES3/I6=SALES * RDUNIF('D4.2');
SALES4/I6=SALES * RDUNIF('D4.2');
SALES5/I6=SALES * RDUNIF('D4.2');
SALES6/I6=SALES * RDUNIF('D4.2');
MONTH/Mt=SEATS;
END
TABLE FILE CAR
BY MONTH
ON TABLE HOLD AS MN FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-SET &HEAD='COUNTRY<+0>SALES<+0>SALES1<+0>SALES2<+0>SALES3<+0>SALES4';
-SET &MN=&LINES;
-REPEAT #GETMN FOR &I FROM 1 TO &MN;
-READFILE MN
-SET &HEAD=&HEAD || '<+0>' || &MONTH;
-#GETMN
TABLE FILE CAR
HEADING
"&HEAD"
SUM
SALES AS ''
SALES1 AS ''
SALES2 AS ''
SALES3 AS ''
SALES4 AS ''
BY COUNTRY AS ''
SUM
SALES5 AS ''
SALES6 AS ''
BY COUNTRY
ACROSS MONTH NOPRINT AS ''
ON TABLE SET HTMLCSS ON
ON TABLE SET ACROSSTITLE SIDE
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
-REPEAT #COLMN FOR &I FROM 1 TO &MN;
-SET &ITEM=6 + &I;
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=&ITEM, COLSPAN=2, $
-#COLMN
ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Danny-SRL,

Yes, I need to display sales5 and sales6 in 2nd line, Is there a way to do it? Thank you very much for your help.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Member
posted Hide Post
Hi Martin,

Thanks for taking time. I did try that, but I also want to display sales5 and sales6 in second line and months in first line i.e. on top of them.
quote:
Originally posted by Martin vK:
Hi Leela,

Look at ACROSSTITLE=SIDE, you will find several posts on how to use this.

A small example would be following:
SET ACROSSTITLE=SIDE
TABLE FILE CAR
SUM
SALES AS ''
BY COUNTRY AS ''
ACROSS SEATS AS 'COUNTRY'
END  


And you would have to add styling to make the country title left-adjusted.

Martin.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Leela,
Sure. There is always a way with WebFOCUS!
  
-SET &ECHO=ALL;
-* File leela01.fex
DEFINE FILE CAR
SALES1/I6=SALES * RDUNIF('D4.2');
SALES2/I6=SALES * RDUNIF('D4.2');
SALES3/I6=SALES * RDUNIF('D4.2');
SALES4/I6=SALES * RDUNIF('D4.2');
SALES5/I6=SALES * RDUNIF('D4.2');
SALES6/I6=SALES * RDUNIF('D4.2');
MONTH/Mt=SEATS;
END
TABLE FILE CAR
BY MONTH
ON TABLE HOLD AS MN FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-SET &HEAD='COUNTRY<+0>SALES<+0>SALES1<+0>SALES2<+0>SALES3<+0>SALES4';
-SET &SHEAD=' <+0>';
-SET &MN=&LINES;
-REPEAT #GETMN FOR &I FROM 1 TO &MN;
-READFILE MN
-SET &HEAD=&HEAD || '<+0>' || &MONTH;
-SET &SHEAD=&SHEAD || '<+0>SALES5<+0>SALES6';
-#GETMN
TABLE FILE CAR
HEADING
"&HEAD"
"&SHEAD"
SUM
SALES AS ''
SALES1 AS ''
SALES2 AS ''
SALES3 AS ''
SALES4 AS ''
BY COUNTRY AS ''
SUM
SALES5 AS ''
SALES6 AS ''
BY COUNTRY
ACROSS MONTH NOPRINT AS ''
ON TABLE SET HTMLCSS ON
ON TABLE SET ACROSSTITLE SIDE
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
-REPEAT #COLMN FOR &I FROM 1 TO &MN;
-SET &ITEM=6 + &I;
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=&ITEM, COLSPAN=2, $
-#COLMN
TYPE=HEADING, LINE=2, OBJECT=TEXT, ITEM=1, COLSPAN=6, $
ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Thank you very much Daniel for taking time to look into this Smiler, It worked like the way I wanted columns to be displayed side by side.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Leela,
You're welcome.
Do you understand the logic behind the solution?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Yes, I do Daniel.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 07, 2016Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Apply Across for selective columns

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