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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] ACROSS IF?
 Login/Join
 
Gold member
posted
I need to sum columns by month, quarter, or year, depending on radio button selected. Is something like this possible?

ACROSS IF &Agro EQ 1 THEN J0.CMSBESTPRACTICESDATA.DATE_MYY AS 'Month Year'
ELSE IF &Agro EQ 3 THEN J0.CMSBESTPRACTICESDATA.HEAD_QUARTER AS 'Quarter Year'
ELSE J0.CMSBESTPRACTICESDATA.HEAD_YEAR AS 'Year';

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


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Virtuoso
posted Hide Post
-* &BYSELECT it's your input parameter that will assigne the proper field / title
-DEFAULTH &BYSELECT = 2
-SET &BYACR = DECODE &BYSELECT (1 REGION
-                               2 ST
-                               3 CITY
-                            ELSE DATE);

-SET &BYACRT = DECODE &BYSELECT (1 'Region'
-                                2 'State'
-                                3 'City'
-                             ELSE 'Date');

TABLE FILE GGSALES
SUM DOLLARS
ACROSS &BYACR AS '&BYACRT'
END


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
CMSBESTPRACTICESDATA.CMSBESTPRACTICESDATA.PROVIDER IN CMSBESTPRACTICESDATA
TAG J0 AS J0
END
SET NODATA = 0
SET &Bound = DECODE &Agro (1 J0.CMSBESTPRACTICESDATA.DATE_MYY 3 J0.CMSBESTPRACTICESDATA.HEAD_QUARTER ELSE J0.CMSBESTPRACTICESDATA.HEAD_YEAR);
SET &Header = DECODE &Agro (1 'Month Year' 3 'Quarter Year' ELSE 'Year');
TABLE FILE HOLDFILEDATA
-*ON TABLE PCHOLD FORMAT XLSX
SUM
J0.CMSBESTPRACTICESDATA.TOTAL_CASES AS 'Total Cases'
J0.CMSBESTPRACTICESDATA.DENOMINATOR_CALC_2 AS 'Opportunities'
J0.CMSBESTPRACTICESDATA.NUMERATOR_CALC_2 AS 'Failures'
BY HOLDFILEDATA.SEG01.PROVIDER AS 'Provider'
BY J0.CMSBESTPRACTICESDATA.SERVICE AS 'Service'
-* ACROSS LOWEST J0.CMSBESTPRACTICESDATA.DATE_MYY AS 'Month Year'
ACROSS &Bound AS '&Header'

When I run this, the report asks for the values of &Bound and &Header. It has the their default values and it runs with those, but the SET statements don't seem to have executed, or maybe they have as they would return the same as the default, but the report doesn't continue with their values.


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Virtuoso
posted Hide Post
You need a - (dash) before the SET of Bound and Header


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
@mbondr: -SET populates variables in DIALOGUE MANAGER (https://webfocusinfocenter.informationbuilders.com/wfappent/pdfs4/wfappslang.pdf). SET adjusts the environment. MartinY's code is using -SET.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
Added the hyphens in front of SET to no effect, still just the default values and the report isn't running with them, but instead is waiting for values.

Could it be where the SET's are? As you may have guessed, I'm a total untrained nube tossed into the deep end.

(see?)

-SET &Bound = DECODE &Agro (1 J0.CMSBESTPRACTICESDATA.DATE_MYY 3 J0.CMSBESTPRACTICESDATA.HEAD_QUARTER ELSE J0.CMSBESTPRACTICESDATA.HEAD_YEAR);
-SET &Header = DECODE &Agro (1 'Month Year' 3 'Quarter Year' ELSE 'Year');


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Silver Member
posted Hide Post
This should get you what you need

 -DEFAULT &BYDISPLAY = '_FOC_NULL';


-SET &BYDATE = IF &BYDISPLAY EQ 'Quarter' THEN 'CMSBESTPRACTICESDATA.CMSBESTPRACTICESDATA.DATE_QYY' ELSE IF &BYDISPLAY EQ 'Year' THEN 'CMSBESTPRACTICESDATA.CMSBESTPRACTICESDATA.DATE_YY' ELSE 'CMSBESTPRACTICESDATA.CMSBESTPRACTICESDATA.DATE_MYY';
-SET &BYDATENAME = IF &BYDISPLAY EQ 'Quarter' THEN 'Quarter' ELSE IF &BYDISPLAY EQ 'Year' THEN 'Year' ELSE 'Month';

TABLE FILE DATA
SUM
field 1
field 2
ACROSS LOWEST &BYDATE AS &BYDATENAME
 


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders