Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Extraer numero de texto

Buenos días, necesito extraer los dos últimos caracteres de esta cadena de texto. Intenté hacerlo con el comando DERECHO y me dio, pero el número de los resultados se mantiene como un texto y lo necesito como un número porque debo realizar operaciones con él. Muchas gracias por la atención y ayuda.

 

  • Anonymous,

     

    You can write an IF ( ) with an ISERROR to only show when there is no error.

    Column = 
    IF (
        NOT (
            ISERROR (
                VALUE (
                    RIGHT ( Table1[Column1], 2 )
                )
            )
        ),
        VALUE (
            RIGHT ( Table1[Column1], 2 )
        )
    )
    
    

     

  • Anonymous's avatar
    Anonymous
    7 years ago

    Excellent!!!!
    Thank you very much for your help. Can I take advantage and ask about a formula to calculate the growth rate?

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hola,

    En power query intenta:

    1-Transforma la columna a Texto (temporalmente)

    2-En el Menu>Transform (o Add Column en caso ocupes una columna extra)>Extract  (aqui seleciona los ultimos 2 characteres)

    3-Cambiar el formato de las columnas de Texto a Numero

  • Anonymous,

     

    You should start another Post as it is not related to this Post.  You should make sure to include sample data that is relevant to your issue.

14 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Good morning Chris Mendoza,
      Thanks for your attention. It shows #ERROR in the column. Already validate that the number does not have spaces

      • ChrisMendoza's avatar
        ChrisMendoza
        Icon for Resident Rockstar rankResident Rockstar

        Anonymous,

         

        My guess is that in your actual data you can't always just take the RIGHT ( ) 2 characters? Possibly you need to take the x characters to the RIGHT of the '-'?

         

        Hm, actually I can't reproduce your error.

         

        Google Translate says:
        you can not convert the 'E' value of the Text type to the tip number

         

        My attempt translating to Spanish using Google Translate

        Esto significa que tiene un carácter 'E' que se encontró en la DERECHA (), 2

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hola,

    En power query intenta:

    1-Transforma la columna a Texto (temporalmente)

    2-En el Menu>Transform (o Add Column en caso ocupes una columna extra)>Extract  (aqui seleciona los ultimos 2 characteres)

    3-Cambiar el formato de las columnas de Texto a Numero

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Joorge_C
      Another solution to what I needed. Thank you very much for your contribution