英文:
ReplaceValue not working in Excel Query Editor
问题
我正在尝试在我的查询编辑器中完成一个"ReplaceValue"步骤,但是似乎根据我设置的条件,值并没有发生变化。
我试图在编辑器中复制以下步骤的代码:
- 当仅对列M应用筛选以仅显示"Required"时,将列N筛选为仅显示"FALSE",并将此值更改为"Outstanding"(将其复制到其余行)。
- 从列N和M中移除筛选。
- 列M - 应用筛选以仅显示"Required"。
- 列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:
- 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)
- Remove filter from Column N & M
- Column M – Apply filter to just show Required
- 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"})
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论