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     Column title on a COMPUTEd field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Column title on a COMPUTEd field
 Login/Join
 
<frankie>
posted
How do you change the column title on a computed field?

I have:
COMPUTE YTD_VAR_PCT/D6.2% = ((C2 - C1) / C1 ) * 100;

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'

Thanks.
 
Report This Post
Platinum Member
posted Hide Post
Hello frankie,

Use the 'AS' for creating titles

COMPUTE YTD_VAR_PCT/D6.2% = ((C2 - C1) / C1 ) * 100; AS 'YTD % Variance'
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Silver Member
posted Hide Post
Hello frankie,

If You are using GUI then directly right click on column and select column title where you directly change the column title.
 
Posts: 30 | Location: India | Registered: February 23, 2005Report This Post
<frankie>
posted
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)));
 
Report This Post
Guru
posted Hide Post
With compute after the sort fields, you cannot change the column title. Frowner (Answer from a case I opened).
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
<frankie>
posted
Ouch! I'll open a case with tech support to see if we're missing anything! I'll keep you "posted"
 
Report This Post
Platinum Member
posted Hide Post
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

We're using 5.2.6.

Ken
 
Posts: 177 | Location: Calgary, Alberta, Canada | Registered: April 25, 2005Report This Post
Guru
posted Hide Post
Doesn't work in 5.21.
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
<frankie>
posted
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
 
Report This Post
Platinum Member
posted Hide Post
Frankie,

I know this may sound like a stupid question, but in your compute I see the following:

COMPUTE
YTD_VAR_PCT/D6.2% = ( ( C2 - C1 ) / C1 ) * 100;

with no AS 'text'

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


Here is my output:

YTD Totals
200401 200402 YTD Variance

2004 31 60 93.55%
 
Posts: 177 | Location: Calgary, Alberta, Canada | Registered: April 25, 2005Report This Post
<frankie>
posted
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)

Thanks again for your persistence,
Frankie
 
Report This Post
<frankie>
posted
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.
 
Report 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     Column title on a COMPUTEd field

Copyright © 1996-2020 Information Builders