[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Ltrim/Rtrim usage
- Subject: RE: [sqr-users] Ltrim/Rtrim usage
- From: "Alexander, Steve" <Steven.Alexander@sanjoseca.gov>
- Date: Tue, 30 Nov 2004 11:04:05 -0800
- Delivery-date: Tue, 30 Nov 2004 14:05:51 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
Replace() is a good function to replace (no pun intended) both ltrim and
rtrim. But be careful if there could be a "TAX" in the middle of the string
that you don't want to remove.
-----Original Message-----
From: sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org
[mailto:sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org]On
Behalf Of Jeff.Steinfeldt@wellsfargo.com
Sent: Tuesday, November 30, 2004 10:48 AM
To: sqr-users@sqrug.org
Subject: RE: [sqr-users] Ltrim/Rtrim usage
LTRIM and RTRIM aren't the best choice for something like this because they
will act on individual bytes in your 'TAX' string instead of considering the
whole string in its entirety. That's why the 'A' that you want to keep is
getting wacked.
Better, I think, to use REPLACE if you are looking for a series of known
values that won't occur in the portion of the string that you want to
isolate.
begin-report
LET $document1 = '8710212004ATAX'
DISPLAY $document1
LET $document1 = REPLACE($document1,'TAX','')
DISPLAY $document1
end-report
-----Original Message-----
From: sqr-users-bounces+jeff.steinfeldt=wellsfargo.com@sqrug.org
[mailto:sqr-users-bounces+jeff.steinfeldt=wellsfargo.com@sqrug.org] On
Behalf Of Kaz.Narayanan@averydennison.com
Sent: Tuesday, November 30, 2004 12:29 PM
To: This list is for discussion about the SQR database reporting language
from Hyperion Solutions.
Subject: [sqr-users] Ltrim/Rtrim usage
Hi,
I am trying to trim a value 'TAX' in an SQR.
My codes are as follows:
let $document1 = ltrim($document , 'TAX')
let $document1 = Rtrim($document1 , 'TAX')
let $document1 = ltrim($document1 , ' ')
let $document1 = rtrim($document1 , ' ')
For Example if I have a value of '8710212004ATAX' in $document I want
$document1 to be '8710212004A' without the 'TAX' however, the $document1 is
also trimming the 'A' before the 'TAX'. I want the $document1 to be
'8710212004A'
Am I doing anything wrong? Any Suggestions?
Thanks
Regards
KM Narayanan
-----------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users