ReplaceValue 在 Excel 查询编辑器中不起作用。

huangapple go评论65阅读模式
英文:

ReplaceValue not working in Excel Query Editor

问题

我正在尝试在我的查询编辑器中完成一个"ReplaceValue"步骤,但是似乎根据我设置的条件,值并没有发生变化。

我试图在编辑器中复制以下步骤的代码:

  1. 当仅对列M应用筛选以仅显示"Required"时,将列N筛选为仅显示"FALSE",并将此值更改为"Outstanding"(将其复制到其余行)。
  2. 从列N和M中移除筛选。
  3. 列M - 应用筛选以仅显示"Required"。
  4. 列N - 应用筛选以仅显示"TRUE",并将此值更改为"Received"(将其复制到其余行)。

以下是我尝试完成的上下文截图:
[1]: https://i.stack.imgur.com/Igc2q.png

= Table.ReplaceValue(#"Replaced Value7",每个[P&C信息收到],每个如果[P&C信息需要] = "Required"且[P&C信息收到] = "false",则"Outstanding",否则如果[P&C信息需要] = "Required"且[P&C信息收到] = "true",则"Received",否则[P&C信息收到],Replacer.ReplaceText,{"P&C信息收到"})

M和N是我在电子表格表中处理的列。

英文:

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).

Screenshot and below for context on what I am trying to complete
[1]: https://i.stack.imgur.com/Igc2q.png

= 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.

答案1

得分: 1

= 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"})

英文:

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"})

huangapple
  • 本文由 发表于 2023年7月20日 18:15:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76728852.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定