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.
I need to calculate the delta between two dynamic values that are really in the same column - year over year.
I developed a work around using an ACROSS - and then placed the COMPUTE after the ACROSS - which gave me the value I wanted in the place I wanted. Try it without the across, and you get a mess.
Trouble is, I cannot style the new DELTA column or add conditional styling - something I need for negative numbers. Nothing I do is recognized (except SQUEEZE width, which is respected).
Here is the code and an example of the output. I would be happy to get rid of the ACROSS if there is some way to calculdate the delta via something like C3(R2-R1) which I tried to no avail.
-DEFAULT &DBS1 = 'SURG'
-DEFAULT &Year = '2010'
-DEFAULT &Month = '09'
-SET &PRYEAR= &Year -1 ;
-SET &PRYEAR2= &Year -2 ;
-SET &PRYEAR3= &Year -3 ;
-INCLUDE inc_varsre.fex
TABLE FILE NDAY_GEAC_SUMMARY
SUM
TOTAL_GRANT_AMT/D12CM AS ''
BY &SORTVAR AS 'Grant Spending (YTD)'
ACROSS YEAR AS ''
COMPUTE
TOTAL_GRANT_AMT/D12C = ( C3 - C2 ); AS 'Delta'
WHERE YEAR EQ '&Year' OR '&PRYEAR';
WHERE EDIT(YEARMO,'$$$$99') LE '&Month';
WHERE &WHEREVAR EQ '&MEDDIV';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
PAGECOLOR='WHITE',
$
TYPE=REPORT,
BORDER-TOP=LIGHT,
BORDER-BOTTOM=LIGHT,
BORDER-LEFT=LIGHT,
BORDER-RIGHT=LIGHT,
BORDER-TOP-COLOR=RGB(18 72 124),
BORDER-BOTTOM-COLOR=RGB(18 72 124),
BORDER-LEFT-COLOR=RGB(18 72 124),
BORDER-RIGHT-COLOR=RGB(18 72 124),
FONT='VERDANA',
SIZE=8,
COLOR='BLACK',
STYLE=NORMAL,
JUSTIFY=CENTER,
$
TYPE=DATA,
COLUMN=N1,
FONT='CALIBRI',
JUSTIFY=LEFT,
$
TYPE=TITLE,
BORDER-TOP=LIGHT,
BORDER-BOTTOM=LIGHT,
BORDER-LEFT=LIGHT,
BORDER-RIGHT=LIGHT,
BORDER-TOP-COLOR=RGB(18 72 124),
BORDER-BOTTOM-COLOR=RGB(18 72 124),
BORDER-LEFT-COLOR=RGB(18 72 124),
BORDER-RIGHT-COLOR=RGB(18 72 124),
FONT='ARIAL',
SIZE=8,
COLOR='WHITE',
BACKCOLOR=RGB(18 72 124),
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N1,
JUSTIFY=LEFT,
$
TYPE=ACROSSVALUE,
ACROSS=1,
BORDER-TOP=OFF,
BORDER-BOTTOM=LIGHT,
BORDER-LEFT=OFF,
BORDER-RIGHT=OFF,
FONT='ARIAL',
SIZE=7,
COLOR=RGB(18 72 124),
STYLE=BOLD,
$
TYPE=ACROSSTITLE,
ACROSS=1,
FONT='ARIAL',
SIZE=7,
COLOR=RGB(18 72 124),
STYLE=BOLD,
$
TYPE=REPORT,
COLUMN=N1,
SQUEEZE=1.791667,
$
TYPE=REPORT,
COLUMN=N4,
SQUEEZE=0.791667,
$
TYPE=REPORT,
COLUMN=N3,
SQUEEZE=0.791667,
$
TYPE=REPORT,
COLUMN=N2,
SQUEEZE=0.791667,
$
ENDSTYLE
END
And BTW, this is one of many fex that are placed on a DOC COMPOSER page for final output.This message has been edited. Last edited by: Damon,
-SET &THIS_YEAR = EDIT(&YYMD,'9999');
-SET &LAST_YEAR = &THIS_YEAR - 1;
...
TABLE FILE NDAY_GEAC_SUMMARY
SUM
COMPUTE TOTAL_GRANT_AMT_LY/D12CM = IF YEAR EQ &LAST_YEAR THEN TOTAL_GRANT_AMT ELSE 0; AS 'Grant &LAST_YEAR'
COMPUTE TOTAL_GRANT_AMT_TY/D12CM = IF YEAR EQ &THIS_YEAR THEN TOTAL_GRANT_AMT ELSE 0; AS 'Grant &THIS_YEAR'
COMPUTE TOTAL_GRANT_AMT_DL/D12C = ( TOTAL_GRANT_AMT_TY - TOTAL_GRANT_AMT_LY ); AS 'Delta'
BY &SORTVAR AS 'Grant Spending (YTD)'
...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server