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     Changing Column Title Dynamically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Changing Column Title Dynamically
 Login/Join
 
Platinum Member
posted
Hello,

I am trying to change a column title dynamically. If the title (fleetnumber) comes across from the database as 9999 I want it to say MISC. if the column title comes across as 88 I want it to say DED. Besides those headings I also have numbers 1 - 87 that I want to leave as is.

I tried doing it through the stylesheet and through the -SET but can't seem to get it to work either way.

Thanks for the help in advance,
Kelly


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Platinum Member
posted Hide Post
Hi Tom,

Thanks for the quick response. Here is the code that I'm using. I got the define field to check out ok but now I can't get it to work in the reports code.

DEFINE FILE YTD$
NEWFLEETID/I4=FLEETID;
NEWTRNOV/I6=TURNOVER;
TODAY/YYMD='&YYMD';
CURRMON/YYM=TODAY;
PREVMON/YYM=CURRMON-1;
NEWDATE/YYMD=HDATE(DATE, 'YYMD');
NEWMNTH/YYM=NEWDATE;
FLDNAM2/A20='YTD';
FLDNAM3/A20='YTD Cost';
TODAYSDATE/MDYY=TODAY;
MISC/A5=
IF NEWFLEETID EQ '9999' THEN 'MISC' ELSE
IF NEWFLEETID EQ '88' THEN 'DED ' ELSE EDIT( NEWFLEETID ,'9999');
END

TABLE FILE YTD$
SUM
'YTD$.YTD$.NEWTRNOV/I8' AS ' '
BY HIGHEST 'YTD$.YTD$.NEWMNTH' AS 'Turnover'
ACROSS 'YTD$.YTD$.NEWFLEETID' AS ' '
HEADING
"EXECUTIVE SUMMARY OF OPERATIONS ACTIVITIES"
" "
"FLEET ISSUES:"
"WHERE ( NEWMNTH EQ CURRMON ) OR ( NEWMNTH EQ PREVMON );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
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=DATA,
COLUMN=N1,
FONT='ARIAL',
SIZE=9,
STYLE=BOLD,
$
TYPE=DATA,
ACROSSCOLUMN=N1,
FONT='ARIAL',
SIZE=9,
$
TYPE=TITLE,
COLUMN=N1,
FONT='ARIAL',
SIZE=9,
STYLE=BOLD,
$
TYPE=TITLE,
ACROSSCOLUMN=N1,
FONT='ARIAL',
SIZE=9,
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
SIZE=12,
STYLE=BOLD+UNDERLINE,
$
TYPE=HEADING,
LINE=3,
OBJECT=TEXT,
ITEM=1,
STYLE=BOLD,
$
TYPE=HEADING,
LINE=3,
OBJECT=TEXT,
ITEM=2,
STYLE=UNDERLINE,
$
TYPE=HEADING,
LINE=4,
OBJECT=TEXT,
ITEM=1,
SIZE=9,
$
TYPE=HEADING,
LINE=4,
OBJECT=FIELD,
ITEM=1,
SIZE=9,
$
TYPE=ACROSSVALUE,
ACROSS=1,
FONT='ARIAL',
SIZE=9,
STYLE=BOLD,
$
TYPE=ACROSSVALUE,
ACROSS=1,
COLOR='RED',
WHEN=N1 EQ 9999,
$
TYPE=ACROSSTITLE,
ACROSS=1,
FONT='ARIAL',
SIZE=9,
STYLE=BOLD,
$
ENDSTYLE
END


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Expert
posted Hide Post
Kelly,

You are DEFINing the MISC field but are not using it anywhere in your code (I trapped the output to get it all).

Looking at your code though, would I be correct in thinking you want the MISC as the column title on NEWFLEETID? If so then just -
......
MISC/A5=DECODE NEWFLEETID (9999 'MISC' 88 'DED ' ELSE EDIT( NEWFLEETID ,'9999'));
END

TABLE FILE YTD$
SUM NEWTRNOV/I8 AS ' '
BY HIGHEST NEWMNTH AS 'Turnover'
ACROSS MISC AS ' '
etc.


T

p.s. enclose your code snippets in [ code] and [/code] tags (without the spaces).

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi Tom,

I am getting an error with the define field saying) SYNTAX ERROR IN DECODE ELSE CLAUSE.

MISC/A5=DECODE NEWFLEETID ('9999' 'MISC' '88' 'DED' ELSE EDIT(NEWFLEETID, '9999'));

I took from the else to the end out and I didn't get an error when I checked it.

When I put the code in the report like you said I'm only getting the DED and MISC columns now. I need all the columns 1 - 87 plus DED and MISC.

1 2 3 4 5 6 ..... DED MISC

I hope that makes sense.

Thanks for your help.


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Platinum Member
posted Hide Post
Hi Tom,

Thanks, that worked. Now the only other problem I have with it is that the numbers 1 - 87 are coming back as 0001, 0002, 0003, ....0087. It is putting zeros in front of it so it is A4. I can't have that either. I don't know if I need to do another define or what.

Thanks again for the help.
Kelly


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Expert
posted Hide Post
Kelly,

The reason that you are getting 0001 etc is because of the edit. Look up the FTOA function but remember that you need to get the host numeric into a decimal or floating point value first.

Also note that the NEWFLEETID was defined as an integer so the equality test should not have the single quotes around the value.

i.e. NEWFLEETID EQ 88 and not NEWFLEETID EQ '88'

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
I didn't get the above code to work but here is the version I did get to work:

FLEET/A5 = FTOA(NEWFLEETID, '(D4)', FLEET);
MISC/A5 = IF (TRIM('L', FLEET, 5, ' ', 1, 'A5')) EQ '9,999' THEN 'MISC'
ELSE IF FLEET EQ ' 88' THEN 'DED'
ELSE FLEET;
END
TABLE FILE YTD$
SUM
'YTD$.YTD$.NEWTRNOV/I8' AS ' '
BY HIGHEST 'YTD$.YTD$.NEWMNTH' AS 'Turnover'
ACROSS MISC AS ' '


Thanks for everyones help


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report 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     Changing Column Title Dynamically

Copyright © 1996-2020 Information Builders