Forum Discussion

Decal's avatar
Decal
Icon for Helper I rankHelper I
2 years ago
Solved

Table.ReplaceValues Only accepts my last entry

I have 10 records where I need to populate a null.  I add these statements using Advanced Editor.  At first I thought it was working, because when I added the first statement and tested it, it worked...
  • m_dekorte's avatar
    2 years ago

    Hi Decal,

    You forgot to update all table references by which I mean the #"Changed Type" here in your code.

    Table.ReplaceValue(#"Changed Type",

     

    For the first line of code that is probably true (I can't verify as it is not included in the snippet)

    But for the second line you should pass your transformed table on, like so:

    #"AddTimeType1" = Table.ReplaceValue(#"Changed Type", null, each if [Job Requisition] = "R2620 ... }),
    #"AddTimeType2" = Table.ReplaceValue(#"AddTimeType1",null, each if [Job Requisition] = "R3334 ... }),
    #"AddTimeType3" = Table.ReplaceValue(#"AddTimeType2", and so on.

     

    I hope this is helpful