Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Get Week number from Source name value using Mcode

Hi,

I hope to get week number after right-most delimiter '_' which the result will be 'W35'.

Also wanna know how I can get only number such '35' as well. 

 

 

 

  • Heyy Anonymous 
    Please try this 
    Text.BeforeDelimiter( Text.AfterDelimiter([Column1], "_", 1), ".",0)


    If it helps please Kudos To Work and Accept it as Solution.

  • Heyy @jeongkim 
    Please try this 
    Text.End( Text.BeforeDelimiter( Text.AfterDelimiter([Column1], "_", 1), ".",0),2)

     

     


    If it helps please Kudos To Work and Accept it as Solution.

  • Hi Anonymous 

     

    In the GUI, go to either Transform or Add Column tab, select Extract then Between Delimiters.

     

5 Replies

  • dharmendars007's avatar
    dharmendars007
    Memorable Member

    Hello Anonymous , 

     

    Please try the below mcode to get the desired result..

     

    = Text.AfterDelimiter([Source Name], "_", 1)

     

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, I need only W35 and 35 without '.xlsx' please

      • elitesmitpatel's avatar
        elitesmitpatel
        Solution Supplier

        Heyy Anonymous 
        Please try this 
        Text.BeforeDelimiter( Text.AfterDelimiter([Column1], "_", 1), ".",0)


        If it helps please Kudos To Work and Accept it as Solution.

  • Hi Anonymous 

     

    In the GUI, go to either Transform or Add Column tab, select Extract then Between Delimiters.