I tested this in adf and a combination of substring and lastindex of functions did the trick. see the screenshot below. There is an '_' before the datepart starts. in the substring I am selecting the string from the beginning till last '_'.