为什么我可以在Google查询中使用多个倍数?

发布于 2025-01-21 13:27:38 字数 479 浏览 2 评论 0原文

我目前正在尝试缩小数据范围。我想消除我不想在查询中提取的某些值。

首先,我想消除 - (dash),

=query(A1:B,"select A where NOT A LIKE '%-%'") 
That works, 

但是,如果我想继续缩小数据缩小,则使用的数据

=query(A1:B,"select A where NOT A LIKE '%-%' or NOT A LIKE '%WOLF%'")

不起作用。而不是缩小我的数据,而是增加了仪表板并保留狼。如何继续不喜欢多个字符串?

I am currently trying to narrow down my data. I want to eliminate certain values that I do not want to pull in the query.

First I want to eliminate the - (dash)

=query(A1:B,"select A where NOT A LIKE '%-%'") 
That works, 

But, if I want to continue to narrow down my data I use

=query(A1:B,"select A where NOT A LIKE '%-%' or NOT A LIKE '%WOLF%'")

That does not work. Instead of narrowing down my data it adds the dash back and keeps wolf . How can I keep using NOT like for multiple strings?
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不寐倦长更 2025-01-28 13:27:38

使用括号使逻辑更易于遵循,例如:

= query(a1:a,“ where not(a)不(类似'% - %'或类似'%wolf%')),0)

Use parentheses to make the logic easier to follow, like this:

=query(A1:A, "where not (A like '%-%' or A like '%WOLF%')", 0)

薄暮涼年 2025-01-28 13:27:38

最好使用以下等高语:

=QUERY(A1:A, "where not A matches '.*-.*|.*WOLF.*'")

better to use regex like:

=QUERY(A1:A, "where not A matches '.*-.*|.*WOLF.*'")
梦里泪两行 2025-01-28 13:27:38

只是为了增加对话,第二个查询将返回任何没有狼和破折号的东西。因此,如果我的数据中有“狼人”和“灰狼”。我会得到“灰狼”,而不是“狼人”。为什么?
或操作员告诉查询如果不是一个或另一个,请返回某些东西。 “灰狼”不像'% - %'。即使它会被“%wolf%”语言过滤,但它是由OR语句的第一部分捕获的,因此查询说:“是的,这就是这样或那样,因为它就像您的无dash语言,我会退还。”和Visa Versa。如果您的数据中有“ mole-person”,那将弹出,因为它不像'%wolf%',并且查询会说:“好吧,我有破折号,但不是狼,所以我会包括它。”

上面的用户建议和操作员,因为这是为了过滤狼和破折号而需要的。它的写作方式,一个单元格必须像查询一样排除它。

我希望这能澄清。

Just to add to this conversation, the second query will return anything that does not have Wolf AND a dash in it. So if I have "Wolf-man" and "Gray Wolf" in my data. I will get "Gray Wolf" back but not "Wolf-Man." Why?
The OR operator tells the query to return something if it's not like one OR the other. "Gray Wolf" is not like '%-%'. Even though it would get filtered by the OR '%Wolf%' language, it's captured by the first part of the OR statement, and so the query says "Yes, this is like this or that, since it is like your no-dash language, I'll return it." And visa versa. If you had "Mole-person" in your data, that would pop up, since it's not like '%Wolf%' and the query will say "well, i's got a dash but it's not a wolf, so I'll include it."

Users above suggested the AND operator, since that is what you'll need in order to filter out BOTH wolves AND dashes. The way it is written, a cell must be like BOTH for the query to exclude it.

I hope this clarifies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文