Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have a column in a table which is the combination of numeric and special charecters. I would like to extract last four charecters before the delimeter and ignore the leading 0 from it and populate the values to a new column. (Looking for a method to achieve this using M )
Sample Data:
As highligted with a color, there are cases when an extra special charecter appear in the data(can be because of human error), that should be corrected in the result.
SQL query used: LTRIM(RIGHT(SPLIT_PART(Column1, '-', 0), 4), 0) AS Desired Result (This query doesnt address 152-00003- values)
Any Help will be appreciated.
Thank You.
Solved! Go to Solution.
Is this what you are looking for?
Number.FromText(
Text.End(
Text.BeforeDelimiter([Column1],"-",RelativePosition.FromStart),
4)
)
it might be better that way!
Yes but for the values like (152-00003-) it should produce 3 as the result instead if 152
if List.Count(Text.Split([Column1],"-"))>2 then Number.FromText(Text.End(Text.BeforeDelimiter([Column1],"-",
RelativePosition.FromEnd),4))
else Number.FromText(Text.End(Text.BeforeDelimiter([Column1],"-",
RelativePosition.FromStart),4))
Is this what you are looking for?
Number.FromText(
Text.End(
Text.BeforeDelimiter([Column1],"-",RelativePosition.FromStart),
4)
)
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |