Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Maciej29
Contributor III
Contributor III

How to replace words with digits.

Hello,

I need to clean up this column [Name list] from fields with digits, but i cannot delete them, i can only make it blank. If some of them don't have any digit, then i have to leave them unchangeable. How to make it using 'Set expression' ?

Capture.PNGThank you in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Or like this:

=If(not FindOneOf([Name list],'0123456789'), [Name list])

Or (with set analysis),

=Aggr(Only( {<[Name list]={"=not FindOneOf([Name list],'0123456789')"}>} [Name list]), [Name list])

tresesco_0-1596698559659.png

 

View solution in original post

5 Replies
Lisa_P
Employee
Employee

Is this what you are trying to do?

Load
If(FindOneOf([Name list],'0123456789')=0, [Name list], null()) as NewList;
LOAD * INLINE
[
Name list
Truck
Q3JohnG
16C
T5Q
U61
H1A
710G
H12G
Cirle
Flow
Garden
ZC5
](delimiter is ',');

Maciej29
Contributor III
Contributor III
Author

Thank you Lisa,but  I would prefer set expression as i'm not enough familiar with script writing. Could you show it in this way ?

Lisa_P
Employee
Employee

So you just want to replace them with nothing on the chart ?

If so, try this expression as a measure in a chart if Name list is a dimension.

Only({<[Name list]=-{"*1*"}-{"*2*"}-{"*3*"}-{"*4*"}-{"*5*"}-{"*6*"}-{"*7*"}-{"*8*"}-{"*9*"}-{"*0*"}>}[Name list])

Lisa_P_0-1596697219723.png

 

tresesco
MVP
MVP

Or like this:

=If(not FindOneOf([Name list],'0123456789'), [Name list])

Or (with set analysis),

=Aggr(Only( {<[Name list]={"=not FindOneOf([Name list],'0123456789')"}>} [Name list]), [Name list])

tresesco_0-1596698559659.png

 

Maciej29
Contributor III
Contributor III
Author

Thank you Lisa, but its not in chart.Also  I've checked with table and it works. I need it for filter. Even though, thank you for support.