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]CHANGE INTERGER TO CHARACTER

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]CHANGE INTERGER TO CHARACTER
 Login/Join
 
Gold member
posted
Hello to all,

I would like to convert this integer to a character. I have the code below, but it seems to be padding the number with zero's:

 CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE EDIT(INC_INCIDENT_ID); 


Changes 200993916 to 00200993916. I need the zero's removed.

This message has been edited. Last edited by: QuickLearner,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 96 | Registered: October 13, 2014Report This Post
Guru
posted Hide Post
quote:
Originally posted by QuickLearner:
Hello to all,

I would like to convert this integer to a character. I have the code below, but it seems to be padding the number with zero's:

 CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE EDIT(INC_INCIDENT_ID); 


Changes 200993916 to 00200993916. I need the zero's removed.




 CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE EDIT(INC_INCIDENT_ID, '$$9999999999999'); 


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Gold member
posted Hide Post
quote:
Originally posted by MattC:
quote:
Originally posted by QuickLearner:
Hello to all,

I would like to convert this integer to a character. I have the code below, but it seems to be padding the number with zero's:

 CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE EDIT(INC_INCIDENT_ID); 


Changes 200993916 to 00200993916. I need the zero's removed.




 CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE EDIT(INC_INCIDENT_ID, '$$9999999999999'); 


Perfect. Thank you!!!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 96 | Registered: October 13, 2014Report This Post
Virtuoso
posted Hide Post
Will work while you only have 2 leading zeros.
This will don't care about how many zeros:
CR_NUMBER/A15= IF INC_INCIDENT_ID EQ 0 THEN '' ELSE FPRINT(INC_INCIDENT_ID, 'abc', 'A15'); 

Where abc = the format of INC_INCIDENT_ID such as P13, D13, ...


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
Virtuoso
posted Hide Post
Well the EDIT is only going to work for numbers from 100000000 to 999999999, which is ok if all your numbers are in that range.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
quote:
Well that is only going to work for numbers from 100000000 to 999999999, which is ok if all your numbers are in that range.

Alan above comment is applicable to the EDIT command suggested by MattC.


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
Virtuoso
posted Hide Post
Yes indeed Martin. I was writing as you posted I reckon. FPRINT is the correct approach.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report 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]CHANGE INTERGER TO CHARACTER

Copyright © 1996-2020 Information Builders