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
May 29, 2018, 05:43 PM
Waz
Can you give an example, say with one of the sample files like CAR ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
May 29, 2018, 06:44 PM
Leela Krishna
Hi Waz,
Thanks for taking time, This is how my output should look like, If I am creating report on car file
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 krishnaThis message has been edited. Last edited by: Leela Krishna,
WebFOCUS 8 Windows, All Outputs
May 29, 2018, 07:59 PM
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
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
May 31, 2018, 10:16 AM
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
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
May 31, 2018, 01:38 PM
Leela Krishna
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
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
May 31, 2018, 01:40 PM
Leela Krishna
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
May 31, 2018, 05:27 PM
Waz
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.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
June 01, 2018, 05:49 PM
Leela Krishna
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
June 03, 2018, 04:10 AM
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 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
June 03, 2018, 08:22 AM
Danny-SRL
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
June 04, 2018, 10:46 AM
Leela Krishna
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
June 04, 2018, 10:52 AM
Leela Krishna
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
June 04, 2018, 12:40 PM
Danny-SRL
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
June 06, 2018, 08:36 AM
Leela Krishna
Thank you very much Daniel for taking time to look into this , It worked like the way I wanted columns to be displayed side by side.
WebFOCUS 8 Windows, All Outputs
June 06, 2018, 09:20 AM
Danny-SRL
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