Forum Discussion

Rsanjuan's avatar
Rsanjuan
Icon for Advocate III rankAdvocate III
9 years ago
Solved

Correcting a number value in data

Hi,

 

I am trying to correct a number value that was entered incorrectly in the database.  I am basically using the add custom but not sure why it's not working.

 

 

 

Am I do something incorrectly?  Thanks!

 

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Rsanjuan,

     

    So you want to replace current value based on other columns, right?

    If this is a case, you can try to add a custom steps and use below formula:

     

     ReplaceValue= Table.ReplaceValue(#"Changed Type",each [Bid Value V2],each if [Job.Name] = "S0S17800487" then 78570 else [Bid Value V2] ,Replacer.ReplaceValue,{"op_id"})

     

    Sample:

     

    Reference link:
    Query editor replacing values based on another column

     

    Regards,

    Xiaoxin Sheng

4 Replies

  • I don't believe that you can edit the numbers within a column by creating another custom column.

     

    I would do this:

    =if [Job.Name]="SOS17800487" then 78570 else [Bid Value v2]

     

    So it would copy all of the values from [Bid Value v2] except when the [Job.Name] is equal to SOS17800487. Then it would use 78570.

     

    Then you can delete [Bid Value v2]

     

    I am assuming that you want 78570 as a numerical value. If you want it as a text value, then you have to place it within quotation marks.

     

    Let me know if this helps!

    • Rsanjuan's avatar
      Rsanjuan
      Icon for Advocate III rankAdvocate III

      bdymit

       

      This may be a dumb question, but where exactly where would I put that?  In the edit query mode?

       

       

      • bdymit's avatar
        bdymit
        Icon for Resolver II rankResolver II

        Yep! While editing your query, click "Add Custom Column" and then use that formula and whatever Column Header you would like.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Rsanjuan,

     

    So you want to replace current value based on other columns, right?

    If this is a case, you can try to add a custom steps and use below formula:

     

     ReplaceValue= Table.ReplaceValue(#"Changed Type",each [Bid Value V2],each if [Job.Name] = "S0S17800487" then 78570 else [Bid Value V2] ,Replacer.ReplaceValue,{"op_id"})

     

    Sample:

     

    Reference link:
    Query editor replacing values based on another column

     

    Regards,

    Xiaoxin Sheng