Focal Point
[CLOSED] how put a sales to the right of across total

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7727070886

October 20, 2017, 08:20 AM
vnf
[CLOSED] how put a sales to the right of across total
Hello,

I am trying to create a report where I want to put some fields right of a across total. Can someone please help me?

here is a sample code using the car file where the sales is left of the across data. I want to be able to put "the total sales" to be right side "the total of seats".


TABLE FILE CAR
SUM
CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
SUM
CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
ACROSS LOWEST CAR.COMP.CAR ACROSS-TOTAL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

thanks,

Vera

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


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 08:34 AM
Mikel
Hi Vera.

Try with RECAP command after ACROSS:

TABLE FILE CAR

SUM 
CAR.BODY.SALES NOPRINT
BY CAR.ORIGIN.COUNTRY

SUM 
CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
ACROSS LOWEST CAR.COMP.CAR ACROSS-TOTAL
RECAP TOTSALES/D15 = C1 ;
-* C1 refers to the sales of first SUM verb.

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty, $
END


Regards. Mikel.


WebFOCUS 8.1.05, 8.2.01
October 20, 2017, 09:16 AM
vnf
It works. thank Mikel.

I have added a column-total by in some cases I do not want the RECAP columns (in this case seats) not to be calculated. I tried to just total the columns I want but it is not working. Does someone know to do it?

here is the complete code:

TABLE FILE CAR
SUM
CAR.BODY.SALES NOPRINT
BY CAR.ORIGIN.COUNTRY
SUM
CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
ACROSS LOWEST CAR.COMP.CAR ACROSS-TOTAL
RECAP TOTSALES/D15 = C1 ;

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE COLUMN-TOTAL AS 'TOTAL' 'CAR.BODY.SEATS'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

thanks,
Vera


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 09:24 AM
MartinY
quote:
I have added a column-total by in some cases I do not want the RECAP columns (in this case seats) not to be calculated

This is not clear what you are asking.

You don't want the Seats total but want the Sales at the right ?

Use Mikel sample but without the word ACROSS-TOTAL

If still not what you're asking, provide a data output sample (don't forget to use the code tag. It will keep your sample alignment and make it easier to read)


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 20, 2017, 09:52 AM
vnf
in the column-total line (ON TABLE COLUMN-TOTAL AS 'TOTAL' 'CAR.BODY.SEATS' ),I do want the seats to totaled but not the sales. In my real sample report instead of sales I have Average cost.

Sorry to ask but how can I do the code-tag?

thanks


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 11:25 AM
Mikel
Hi again.

Firstly, if you work with computed statistical variables (Percentages, averages...) consider using RECOMPUTE or SUMMARIZE instead of COLUMN-TOTAL.

In the example, depending what do you want to sum, use case 1 (SUMMARIZE), 2 (SUMMARIZE SEATS), 3 (SUMMARIZE C3, based on RECAP output order):

TABLE FILE CAR
SUM
CAR.BODY.SALES NOPRINT
BY CAR.ORIGIN.COUNTRY
SUM
CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
ACROSS LOWEST CAR.COMP.CAR ACROSS-TOTAL
RECAP TOTSALES/D15 = C1 ;

-* 1. Summarize all
-* ON TABLE SUMMARIZE AS 'Total'
-* Summarize SEATS AND Recap TOTSALES
-* ON TABLE SUMMARIZE SEATS C3 AS 'Total'

-* 2. Summarize only Seats
-* ON TABLE SUMMARIZE SEATS AS 'Total' 

-* 3. Summarize only Recap TOTSALES
ON TABLE SUMMARIZE C3 AS 'Total' 

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,$
END



And finally... "use the code tag" means publish the code between tags. Yo can use the last tool icon provided in post window. Wink

Regards. Mikel


WebFOCUS 8.1.05, 8.2.01
October 20, 2017, 11:37 AM
MartinY
quote:
Sorry to ask but how can I do the code-tag?

Last icon on the ribbon
</>



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 20, 2017, 02:46 PM
vnf
thank you so much.

The issue is that there is a bug in A/S 8.1.0.5


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 03:42 PM
MartinY
I have ran above sample in WF8105M and it work well.

Which gen you have ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 20, 2017, 03:54 PM
vnf
8.1.0.5 (2015)


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 03:55 PM
vnf
Gen Number 858


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
October 20, 2017, 03:59 PM
MartinY
Go to your Client and then select Help / About WebFocus then look at Build/GEN Number

And as for the ReportingServer it's under Help / Version and Gen Number.

But if you don't have the proper result as we have from the sample code, you may need to open a case with TechSupport


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007