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.
and can't figure out how to get a reasonable column title, it displays the field name (YTD_VAR_PCT) and I would like to put something more friendly like 'YTD % Variance'
I had tried the basics, neither works, here is a code snippet for possible clues as to why suggestions don't work and possible solution!
TABLE FILE DIM_PERIOD SUM ITM_EXT_PRC_L_AMT WITHIN TABLE WITHIN YR_NBR AS 'YTD Total' ACROSS YR_NBR AS 'YTD Totals' COMPUTE YTD_VAR_PCT/D6.2% = ( ( C2 - C1 ) / C1 ) * 100; WHERE TRANS_LVL_CD EQ 1 AND (((INV_SHRT_DT GE &FROM_DT_LY_YYMD) AND (INV_SHRT_DT LE &TO_DT_LY_YYMD)) OR ((INV_SHRT_DT GE &FROM_DT_TY_YYMD) AND (INV_SHRT_DT LE &TODAY_YYMD)));
Of course you can change the column title. This might be related to the release. Here's an example I quickly put together and the output clearly shows the computed field with a title of 'COLUMN TITLE'
TABLE FILE TTIMEDIM SUM QUARTER_TOTAL_DAYS NOPRINT BY REPORT_YEAR BY REPORT_QUARTER SUM MONTH_TOTAL_DAYS BY REPORT_YEAR BY REPORT_QUARTER ACROSS REPORT_PERIOD COMPUTE NEW_COL/I6 = C1 ; AS 'COLUMN TITLE' WHERE REPORT_MONTH NE 0 OR 13 WHERE REPORT_YEAR EQ 2004 OR 2005 END
Ken - Simply putting an AS 'Foo' does not work for me, and I also am using 5.2.6. Here is my entire code:
-SET &ECHO='ALL'; -SET &TODAY_YYMD=&YYMD; -SET &THIS_YR=EDIT(&TODAY_YYMD, '9999'); -SET &THIS_MNTH_DAY=EDIT(&TODAY_YYMD, '$$$$9999'); -SET &LAST_YR=&THIS_YR - 1; -SET &FROM_DT_LY=&LAST_YR||0101; -SET &FROM_DT_LY_YYMD=DATECVT(&FROM_DT_LY,'I8','YYMD'); -SET &TO_DT_LY=&LAST_YR||&THIS_MNTH_DAY; -SET &TO_DT_LY_YYMD=DATECVT(&TO_DT_LY,'I8','YYMD'); -SET &FROM_DT_TY=&THIS_YR||0101; -SET &FROM_DT_TY_YYMD=DATECVT(&FROM_DT_TY,'I8','YYMD'); -SET &THIS_MNTH=EDIT(&TODAY_YYMD, '$$$$99$$'); -SET &THIS_MNTH_DAY1=&THIS_YR||&THIS_MNTH||01; -SET &THIS_MNTH_DAY1_YYMD=DATECVT(&THIS_MNTH_DAY1,'I8','YYMD'); -RUN JOIN DIM_PERIOD.DIM_PERIOD.PERIOD_KEY IN DIM_PERIOD TO ALL FCT_DLY_ITM_SLS.FCT_DLY_ITM_SLS.PERIOD_KEY IN FCT_DLY_ITM_SLS AS J0 END JOIN FCT_DLY_ITM_SLS.FCT_DLY_ITM_SLS.CUST_KEY IN DIM_PERIOD TO ALL DIM_CUST.DIM_CUST.CUST_KEY IN DIM_CUST AS J1 END TABLE FILE DIM_PERIOD SUM ITM_EXT_PRC_L_AMT AS ' ' BY CUST_MKT_SGMNT_NM AS ' ' ACROSS YR_NBR AS 'YTD Totals' COMPUTE YTD_VAR_PCT/D6.2% = ( ( C2 - C1 ) / C1 ) * 100; WHERE TRANS_LVL_CD EQ 1 AND (((INV_SHRT_DT GE &FROM_DT_LY_YYMD) AND (INV_SHRT_DT LE &TO_DT_LY_YYMD)) OR ((INV_SHRT_DT GE &FROM_DT_TY_YYMD) AND (INV_SHRT_DT LE &TODAY_YYMD))); ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SET ONLINE-FMT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, $ TYPE=ACROSSVALUE, ACROSS=1, JUSTIFY=LEFT, $ TYPE=ACROSSTITLE, ACROSS=1, JUSTIFY=LEFT, $ ENDSTYLE END
I didn't see anything out of the ordinary in your logic and if you're in 5.2.6 this should work with no problems at all.
I copied your logic and ran the same 'type' of query using one of my tables and it did exactly as I wanted.
Here is what I ran:
TABLE FILE <tablename> SUM YTD_TOTAL_DAYS AS ' ' BY REPORT_YEAR AS ' ' ACROSS REPORT_PERIOD AS 'YTD Totals' COMPUTE YTD_VAR_PCT/D6.2% = ( ( C2 - C1) / C1 ) * 100 ; AS 'YTD Variance' ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SET ONLINE-FMT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, $ TYPE=ACROSSVALUE, ACROSS=1, JUSTIFY=LEFT, $ TYPE=ACROSSTITLE, ACROSS=1, JUSTIFY=LEFT, $ ENDSTYLE END
K. Lane - thanks for your assistance, you've gone beyond the call of duty. I got it to work with a simple addition of AS 'foo', but here's the catch ... when I created the procedure, I checked the "Run With OLAP" box. When I unchecked this, it worked. I only came across this because I went back to a simpler version/procedure of code, when the basic AS clause worked there, I then started looking for other differnces in the 2 procedures.
Any clue as to why "Run With OLAP" would cause an issue with adding a column title? I was hoping to provide the ability to drill into the years (not sure if it makes sense with the construct of BY/ACROSS to provide OLAP drilling capabilities - TBD)
fyi - now (with the AS clause on the compute statement after the sort) I can not open the report in developer studio/report painter. Oh well, I can go edit in text and open with tool.