Forum Discussion
blackhall8
6 years agoFrequent Visitor
Extracting specific dates from text column
I can't seem to figure out how to extract a specific date from a text column in my data table. As you can see below, I have a "Source Column" that includes a comma seperated list of interactions. Wha...
- Anonymous6 years ago
if Text.Contains([Sources], "ZP")
then
Text.Middle([Sources],Text.PositionOf([Sources], "ZP") -13,11)
else
null
Text.Middle goes into sources, starting from the position of "ZP" minus 13 and extracts 11 charachters.
Adjust 13 and 11 if needed.
Anonymous
6 years agoNot applicable
I would add a custom formula in powerquery using a if
ZP Date=
if (string contains ZP) then
find the position of "ZP", go back 13 chars and get 10 chars, trim it -> return this value
else
return emtpy
PreAssessment Date=
if (string contains Pre-Assessment) then
find the position of "ZP", go back 13 chars and get 10 chars, trim it -> return this value
else
return emtpy
etc
TextBetweenDelimiters works fine when your data is very well structured.