Thank you for your questions.
That's the tricky part of the data at this moment I have.
If the text contains 'Alphabetical characters'. then Keep '-'.
If the text contains only dates in the character string ( contains ONLY numerical and '-'). If any character date didn't have the year, month, and date (2018-01-, 2018-), it was considered a partial date. Also, your example is regarded as a partial date. For the time being, it's mandatory to have the 'Year' in my data.
Your case " 'purchase $12.79" we keep '-'.
To make it easier to understand. If the variable contains only 'numeric' and '-' in text, then delete '-' at the end; otherwise, keep it. Please let me know if I missed any scenario
... View more