Replace values using gsub, with pattern defined by string containing data pills
I'm using gsub to substitute values in my data pill, it does not work correctly. Nothing gets replaced even though there is a match. How can I substitute data in my data pills with some other values?
This is my formula:
The "pattern" is being defined by data pills. When I switch the data pills to text, it works correctly. But I need the pattern to be dynamic
Best Answer
A
Amanda Wong
said
over 5 years ago
Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern.
Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following:
Answer
Amanda Wong
said
over 5 years ago
Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern.
Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following:
Saul Macht
Replace values using gsub, with pattern defined by string containing data pills
I'm using gsub to substitute values in my data pill, it does not work correctly. Nothing gets replaced even though there is a match. How can I substitute data in my data pills with some other values?
This is my formula:
The "pattern" is being defined by data pills. When I switch the data pills to text, it works correctly. But I need the pattern to be dynamic
Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern.
Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following:
Amanda Wong
Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern.
Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following: