1

Im trying to complete a table.ReplaceValue step in my query editor but the values dont seem to be changing with the conditions ive set.

The steps im trying to replicate in code in the editor:

  1. Whilst a filter to only show Requried is applied to column M, Filter Column N to only show FALSE and change this value to Outstanding (copy it down to the remaining rows)

  2. Remove filter from Column N & M

  3. Column M – Apply filter to just show Required

  4. Column N – Apply filter to just show TRUE and change this value to Received (copy it down to the remaining rows).

    = Table.ReplaceValue(#"Replaced Value7",each [P&C info received] ,each if [P&C info required] = "Required" and [P&C info received]= "false" then "Outstanding " else if [P&C info required] = "Required" and [P&C info received]= "true" then "Received " else [P&C info received],Replacer.ReplaceText,{"P&C info received"})

M and N are the columns im working with in the spreadsheet table.

3
  • 3
    Your columns are not called M and N. You use the column headers in M code, not the column letter. Commented Jul 20, 2023 at 10:26
  • 3
    As an aside, having spaces at the end of "Received " is just storing up trouble for later - really no need for them Commented Jul 20, 2023 at 11:36
  • What M code changes would I require for my line of code sorry? Commented Jul 20, 2023 at 12:36

1 Answer 1

1

Try this:

= Table.ReplaceValue(#"Replaced Value7",each [P&C info received] ,each if [P&C info required] = "Required" and [P&C info received]= "false" then "Outstanding " else if [P&C info required] = "Required" and [P&C info received]= "true" then "Received  " else  [P&C info received],Replacer.ReplaceText,{"P&C info received"})
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for the reply, tried it and it has an invalid indentifier appearing at the first each [P&C info received]
Paste your full code from advanced editor in your question.
You need [#"P&C info received"]
D'oh. Thanks @horseyride! I didn't spot the ampersands which require this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.