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     [SOLVED] DECODE AND TRIM trailing Space

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DECODE AND TRIM trailing Space
 Login/Join
 
Gold member
posted
Please see the below code.I am trying to "Trim" extra Trailing space for Example For Month "May" OR "June" or "March" or "April" or "July". I searched on the forum Decode and trim fn, I could n't find solution yet. I appreciate any one have thought on this issue....



TABLE FILE PM
PRINT 
COMPUTE SDATE2/A10 = DECODE SDATE1( 01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June' 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December' ELSE 'UNKNOWN' ); 
HEADING
"SDATE2"
END
 


Thank you

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 73 | Registered: April 06, 2016Report This Post
Gold member
posted Hide Post
Couldn't you just create a second compute and use the TRIM function?

TABLE FILE PM
PRINT
COMPUTE SDATE2/A10 = DECODE SDATE1( 01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June' 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December' ELSE 'UNKNOWN' );
COMPUTE SDATE3/A10V = TRIM('T', SDATE2, 10, ' ', 1, 'A10V');
HEADING
"SDATE2"
END

Documentation for TRIM: https://webfocusinfocenter.inf...tm#dcharacter1046848


WebFocus 8.2, IA+, Windows 10, HTML
 
Posts: 56 | Location: UT | Registered: December 01, 2015Report This Post
Gold member
posted Hide Post
Cimmerian,
Thank you for your Reply, It works now I included SQUEEZ inside the TRIMV it works now...
 
     COMPUTE SDATE2T/A17V = TRIMV('T', SQUEEZ(10, SDATE2, 'A10V'), 10, ' ', 1, SDATE2T) ;

 


WebFOCUS 8
Windows, All Outputs
 
Posts: 73 | Registered: April 06, 2016Report This Post
Virtuoso
posted Hide Post
And the following doesn't work for you ? (change SDATE2 from /A10 to /A10V)
TABLE FILE PM
PRINT COMPUTE SDATE2/A10 = DECODE SDATE1( 01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June' 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December' ELSE 'UNKNOWN' ); 
      COMPUTE LENGTH/I2   = LENV(SDATE2, 'I2');
HEADING
"SDATE2"
END


Sample
DEFINE FILE GGSALES
DATEM/MONTH = DATE;
END
TABLE FILE GGSALES
SUM DATEM
    COMPUTE SDATE2/A10V = DECODE DATEM ( 01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June' 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December' ELSE 'UNKNOWN' );
    COMPUTE LENGTH/I2   = LENV(SDATE2, 'I2');
BY DATE
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
Thank you both of your replies


WebFOCUS 8
Windows, All Outputs
 
Posts: 73 | Registered: April 06, 2016Report 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     [SOLVED] DECODE AND TRIM trailing Space

Copyright © 1996-2020 Information Builders