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] Multi-verb Across question?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Multi-verb Across question?
 Login/Join
 
Guru
posted
Requirement I have is to show variance percentages after counts. Not side by side. See code below and image. I am trying to achieve this with a basic table request. I tried to do a multi verb across but its not working. Maybe we can't do a multi-verb across? Looks like I am going to have to pull variance columns seperately hold them and then MORE the data using dummy regions to achieve this. Another issue is that the regions are coming from user input. They can pick from 1 to 5 regions. So the report output is dependent on what the user selects. This report is being developed in 7.7.03 and HTML,PDF,EXL2K output. Any thoughts?

Report output

  
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
SET CENT-ZERO = ON
SET ACROSSLINE = OFF

DEFINE FILE GGSALES
REGION_ORDER/I11 = DECODE REGION('Midwest' 1 'Northeast' 2 'Southeast' 3 'West' 4 ELSE 99);
END

TABLE FILE GGSALES
SUM
    UNITS

BY PRODUCT
BY REGION_ORDER
BY REGION
ON TABLE HOLD AS HDATA
END
-RUN

TABLE FILE HDATA
SUM
   UNITS AS 'PRIMARY'

BY PRODUCT
WHERE REGION EQ 'Midwest'
ON TABLE HOLD AS HPRIMARY
END
-RUN

JOIN PRODUCT IN HDATA TO
     PRODUCT IN HPRIMARY AS J0
END
-RUN

TABLE FILE HDATA
SUM
    UNITS
	COMPUTE VARIANCE/D12.2 = IF UNITS EQ 0 THEN 0 ELSE ((PRIMARY - UNITS)/UNITS) * 100;

BY REGION_ORDER
BY REGION
BY PRODUCT
ON TABLE HOLD AS HRPTDATA
END
-RUN

TABLE FILE HRPTDATA
SUM
    UNITS AS 'Units'
-*ACROSS REGION_ORDER NOPRINT
-*ACROSS REGION
-*BY PRODUCT
-*SUM
    VARIANCE AS '% Variance vs Primary'
ACROSS REGION_ORDER NOPRINT
ACROSS REGION AS ''
BY PRODUCT AS 'Product'
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-RUN

This message has been edited. Last edited by: Mighty Max,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Expert
posted Hide Post
Its not a single table request, but Macgyver may be the way to go.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Waz is right. This does not seem feasible with a single table request but playing around with HOLD files and a bit of dynamic formatting this may work:

SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
SET CENT-ZERO = ON
SET ACROSSLINE = OFF
SET LINES = 999999

DEFINE FILE GGSALES
REGION_ORDER/I11 = DECODE REGION('Midwest' 1 'Northeast' 2 'Southeast' 3 'West' 4 ELSE 99);
END

TABLE FILE GGSALES
SUM
    UNITS
BY PRODUCT
BY REGION_ORDER
BY REGION
ON TABLE HOLD AS HDATA
END
-RUN

TABLE FILE HDATA
SUM
   UNITS AS 'PRIMARY'

BY PRODUCT
WHERE REGION EQ 'Midwest'
ON TABLE HOLD AS HPRIMARY
END
-RUN

FILEDEF HRESULTS DISK hresults.ftm (APPEND
-RUN

-*** Capture UNITS ***
DEFINE FILE HDATA
DATA_GRP/A10 = 'UNITS';
DATA_LBL/A30 = 'Units';
END

TABLE FILE HDATA
PRINT
    UNITS/D12.2 AS 'RESULT'
BY DATA_GRP
BY DATA_LBL
BY PRODUCT
BY REGION_ORDER
BY REGION
ON TABLE HOLD AS HRESULTS
END
-RUN

-*** Capture VARIANCE ***
JOIN PRODUCT IN HDATA TO
     PRODUCT IN HPRIMARY AS J0
END
-RUN

DEFINE FILE HDATA
DATA_GRP/A10 = 'VARIANCE';
DATA_LBL/A30 = '% Variance vs Primary';
END

TABLE FILE HDATA
SUM
	COMPUTE VARIANCE/D12.2 = IF UNITS EQ 0 THEN 0 ELSE ((PRIMARY - UNITS)/UNITS) * 100; AS 'RESULT'

BY DATA_GRP
BY DATA_LBL
BY PRODUCT
BY REGION_ORDER
BY REGION
ON TABLE HOLD AS HRESULTS
END
-RUN

-*** Produce report ***
DEFINE FILE HRESULTS
RSLT_FMT/A8 = IF DATA_GRP EQ 'UNITS' THEN 'D12' ELSE 'D12.2';
END

TABLE FILE HRESULTS
SUM
    RESULT/RSLT_FMT AS ''
ACROSS DATA_GRP NOPRINT
ACROSS REGION_ORDER NOPRINT
ACROSS REGION AS ''
ACROSS DATA_LBL AS ''
BY PRODUCT AS 'Product'
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-RUN



Titles don't show exactly as your sample output but hopefully they are close enough. The ACROSS statements could be changed to something like the following for a slightly different effect:

ACROSS DATA_GRP NOPRINT
ACROSS DATA_LBL AS ''
ACROSS REGION_ORDER NOPRINT
ACROSS REGION AS ''



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
Thanks! I believe the issue is resolved.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report 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] Multi-verb Across question?

Copyright © 1996-2020 Information Builders