| Author |
Message |
bremen
Groupie
Joined: 28 May 2013
Online Status: Offline
Posts: 93
|

Topic: Suppress Text between two characters Posted: 07 Aug 2014 at 1:56am |
|
I am looking for a method to suppress data from a sting that is between two characters. My organization places internal information between two "$" example
$Make sure Jon inspects the package$
How can I suppress that from reports that are viewed externally?
Edited by bremen - 11 Aug 2014 at 2:56am
|
IP Logged |
|
|
|
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
|

Posted: 07 Aug 2014 at 3:31am |
|
Is each instance of the string only going to have this in there once?
if so, and your string looks something like this 'Show$Make sure Jon inspects the package$ This', then do:
split({table.field}, '$')[1] & split({table.field}, '$')[3]
This will produce : 'Show This'
If it can be inside each instance of the string more than once, then you will probably have to do a loop which I am not an expert on.
|
|
|< /\ '][' ( )
|
IP Logged |
|
bremen
Groupie
Joined: 28 May 2013
Online Status: Offline
Posts: 93
|

Posted: 07 Aug 2014 at 4:16am |
|
Where should I put this?
I have a formula
mid({table.field}, 5)
Should I put this after that or in the suppress area of the field?
|
IP Logged |
|
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
|

Posted: 07 Aug 2014 at 5:52am |
|
So does the mid({table.field}, 5) produce the string that has the dollar signs in it?
If so, you can create another formula that is the one I provided, however, replace the {table.field} in my formula with the name of your formula and use my formula in your report instead.
|
|
|< /\ '][' ( )
|
IP Logged |
|
bremen
Groupie
Joined: 28 May 2013
Online Status: Offline
Posts: 93
|

Posted: 11 Aug 2014 at 2:56am |
|
So I followed your solution and received an error
"a subscript must be between 1 and the size of the array. details: errorKind Error in File Report Error in formula Comments: Split(@pocomments '$')[1]
A Subscript must be between 1 and the size of the array
|
IP Logged |
|
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
|

Posted: 11 Aug 2014 at 3:14am |
|
okay, then that means the string does not have a $ in it. Use this revision:
if '$' in {@formula} then (split({@formula}, '$')[1] & split({@formula}, '$')[3]) else {@formula}
|
|
|< /\ '][' ( )
|
IP Logged |
|
bremen
Groupie
Joined: 28 May 2013
Online Status: Offline
Posts: 93
|

Posted: 11 Aug 2014 at 3:48am |
|
Many many many thanks.
|
IP Logged |
|
|
|