Forum Discussion
Anonymous
7 years agoNot applicable
Column split by conditon
I have a requirement to extract/split data if value starts with P or QM to be 7 characters rest should be as-is, how it can be achived? help needed As-is PABCP01A CSOMTO04 PPQRX01M QM0888TA ATL...
- 7 years ago
Anonymous -
Are you meaning that you have so many conditions for Text.StartsWith = "P" || "QM" || etc.?
If so, then you should include those requirements in your question.
Otherwise, you just need to add the logic from the last statment
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([#"As-is"], "P") then Text.RemoveRange([#"As-is"],7) else if Text.StartsWith([#"As-is"],"QM") then Text.RemoveRange([#"As-is"],7) else [#"As-is"])
Anonymous
7 years agoNot applicable
ChrisMendoza i have many such values below is the sample
ChrisMendoza
7 years agoResident Rockstar
Anonymous -
Are you meaning that you have so many conditions for Text.StartsWith = "P" || "QM" || etc.?
If so, then you should include those requirements in your question.
Otherwise, you just need to add the logic from the last statment
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([#"As-is"], "P") then Text.RemoveRange([#"As-is"],7) else if Text.StartsWith([#"As-is"],"QM") then Text.RemoveRange([#"As-is"],7) else [#"As-is"])