[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] quickest way to count how many commas are in a string
- Subject: RE: [sqr-users] quickest way to count how many commas are in a string
- From: "Peter Burton" <Peter_Burton@hyperion.com>
- Date: Fri, 13 Oct 2006 08:34:44 -0400
- Delivery-date: Fri, 13 Oct 2006 08:39:06 -0400
- In-reply-to: <3E842A7A776DEC4FB5A8522E64A9A5D4F60CA6@glkms0009>
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- Thread-index: Acbuv/nP8Zuh3GDjQZ++rWMZq5GBFwAAbexwAACN9RA=
- Thread-topic: [sqr-users] quickest way to count how many commas are in a string
Don,
Good idea ..
Begin-Report
Input $A
Let #C = Length($A) - Length(Replace($A, ',', ''))
Show #C
End-Report
Peter
-----Original Message-----
From: sqr-users-bounces+peter_burton=hyperion.com@sqrug.org
[mailto:sqr-users-bounces+peter_burton=hyperion.com@sqrug.org] On Behalf
Of Simpson, Don I (UK)
Sent: Friday, October 13, 2006 8:21 AM
To: This list is for discussion about the SQR database reportinglanguage
fromHyperion Solutions.
Subject: RE: [sqr-users] quickest way to count how many commas are in a
string
I haven't tried this myself, but it should/might work.
Copy your string into a second temporary variable. Do a REPLACE on this
string to change all ',' to '' (null). Get the length of your original
and the "replaced" temporary string. The difference in length is the
number of commas.
Regards,
Don Simpson
BAE Systems
-----Original Message-----
From: sqr-users-bounces+don.i.simpson=baesystems.com@sqrug.org
[mailto:sqr-users-bounces+don.i.simpson=baesystems.com@sqrug.org] On
Behalf Of Overcashier, Patricia
Sent: 13 October 2006 13:06
To: This list is for discussion about the SQR database reportinglanguage
fromHyperion Solutions.
Subject: [sqr-users] quickest way to count how many commas are in a
string
*** WARNING ***
This mail has originated outside your organization, either from an
external partner or the Global Internet.
Keep this in mind if you answer this message.
I have a string called $selectlist
I need to know how many commas are in it.
Once I know I can unstring it by commas into the right number of
variables and then use those variables What is the simplest way to get a
count of the commas?
Thanks!
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
If you have received this e-mail in error, please delete it and notify the
sender as soon as possible. The contents of this e-mail may be confidential and
the unauthorized use, copying, or dissemination of it and any attachments to
it, is prohibited. Internet communications are not secure and Hyperion does
not, therefore, accept legal responsibility for the contents of this message
nor for any damage caused by viruses. The views expressed here do not
necessarily represent those of Hyperion. For more information about Hyperion,
please visit our Web site at: www.hyperion.com
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users