google-sheets - 如果在某个日期之前,将返回查询中的日期替换为文本
问题描述
我有一份报告,其格式必须更改,删除几列,按类别过滤等。
G 列是日期“YYYY-MM-DD”列,出于我的目的,如果日期在今天之前,我需要将日期单元格更改为字符串“OOD”但是我似乎无法弄清楚我应该如何尝试这个.
我尝试了数组公式和替换等的各种组合,但似乎都破坏了查询。
=QUERY('test data'!1:994,"select C,G,J,K,O where F='FOOD' and C is not null order by K asc",0)
解决方案
试试这样:
=ARRAYFORMULA(QUERY({'test data'!A1:F994,
IF('test data'!G1:G994<TODAY(), "OOD", 'test data'!G1:G994), 'test data'!H1:994},
"select Col3,Col7,Col10,Col11,Col15
where Col6='FOOD'
and Col3 is not null
order by Col11", 0))
推荐阅读
- react-native - 使用 react-navigation v5 测试 react-native-testing-library
- api - 无法使用 SwiftUI 中的组合框架从 Spotify API 获取数据
- scala - Akka 块大小异常
- r - 重新排序 ggplot2 中的列,错误:应使用 `aes() 或 `aes_()` 创建映射
- css - 没有标签的自定义复选框
- python - 将熊猫数据框中的列拟合到动画直方图
- speech-recognition - 是否可以使用 Google Speech 或 IBM Watson 识别非语言单词?
- javascript - 如何使用 Javascript 制作动态 html 弹出窗口?
- r - devtools::document 寻找未调用的包
- node.js - Kubernetes 容器内的内部通信的 Websocket 连接失败