none
Modifying Text in a Column RRS feed

  • Question

  • Hi Team,

    After performing some query operations, I have arrived at a table comprising of two columns. One column is of type text and other is numeric. For the text column I have values like abcd.m1, defg.m, efgh.m2...etc. My requirement is to remove the characters .m1, .m, .m2 from the text and resultant column should have values abcd, defg, efgh.....etc. Can some one guide me how I can achieve this.


    Thanks, Nani

    Tuesday, June 14, 2016 3:16 PM

Answers

  • Add a new step to the query like the following:

    RemovedSuffix = Table.TransformColumns(
                                  <PreviousStepName>,
                                  {
                                     {"<TextColumnName>",
                                     each Text.Start(_, Text.PositionOf(_, ".")), type text}
                                  }
                              )

    Tuesday, June 14, 2016 3:44 PM
  • or

    RemoveAfterDot = Table.SplitColumn(YourPreviousStep,"YourColumnName",Splitter.SplitTextByEachDelimiter({"."}, 0, false),{"YourColumnName"})
    


    Tuesday, June 14, 2016 5:06 PM

All replies

  • Add a new step to the query like the following:

    RemovedSuffix = Table.TransformColumns(
                                  <PreviousStepName>,
                                  {
                                     {"<TextColumnName>",
                                     each Text.Start(_, Text.PositionOf(_, ".")), type text}
                                  }
                              )

    Tuesday, June 14, 2016 3:44 PM
  • or

    RemoveAfterDot = Table.SplitColumn(YourPreviousStep,"YourColumnName",Splitter.SplitTextByEachDelimiter({"."}, 0, false),{"YourColumnName"})
    


    Tuesday, June 14, 2016 5:06 PM