# Query of a split value in a second split value

**URL:** <https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666>\
**Category:** Ask for Help\
**Created:** [April 17, 2024, 3:36pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666 "2024-04-17T15:36:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 3:36pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/1 "2024-04-17T15:36:20Z")

</div>

Hi!

I have this two sheets, one for news, one for opportunities. What i would like to reach is to have in sheet opportunies all the news of a single company.

The problem here is that there are news with two or more companies associated. So if I query the split column of the opportunities associated with the name of the opportunity, the result of the query is that it extract only the news with one name.

Like this:

- News of the opportunity A -\>Query News for the opportunity A
- News of the opportunities A & B → Opportunity A & B doesn’t have nothing

What I would like to have:

- News A & B → each opportunities have the same news

Some screens here of the properties that I tried to set.

![Glide_screen_3](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/b/bb8c221f4cf8335d7a115a8e9f523461ee095446.png)

![Glide_Screen_2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/6/86856439694c9a4bd6f6b5c94a534990a7bde98c.png)

 ![Glide_Screen_1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/1/31e1970c4fd9296c10b0901217e66b22b2e22b65.png)

Thanks for any help 🙏

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 17, 2024, 3:46pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/2 "2024-04-17T15:46:29Z")

</div>

Having a little difficulty following, but could you please show:

- an example of what your raw data looks like
- an example of your desired end result

---

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 3:59pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/3 "2024-04-17T15:59:55Z")

</div>

Yep @Darren_Murphy,

I created this file with raw data and result that i want:

> **[Example relation opp-news](https://docs.google.com/spreadsheets/d/1JBehhBwzay01H1euD6TZQUsdytooDSSjg2OLvC9GBiU/edit?usp=sharing)**
>
> Opportunities
> 
> Name,Relation News
> Opportunity A,News 1, News 3, News 2
> Opportunity B,News 1
> Opportunity C,News 2

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 17, 2024, 4:07pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/4 "2024-04-17T16:07:55Z")

</div>

So from your example, the Opportunity column in your News table should be computed, yes?

- Create a Split Text column in your Opportunities table that targets the second column
- Create a relation column in your News table that matches the name with the split text column in the Opportunities table

 ![CleanShot 2024-04-18 at 00.06.44@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/9/79c9c952aefc993e51b281ee6e3ed00dd5454418.png)

 ![CleanShot 2024-04-18 at 00.07.04@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/a/ea904383d32ce103cbd28ecf09d275645d76f06a.png)

I’m not sure if that’s exactly what you are looking for?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 17, 2024, 4:12pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/5 "2024-04-17T16:12:39Z")

</div>

I feel like this should work. Comparing an array to an array should trigger a match if any one item matches in both arrays. What I’m a bit suspicious on is extra spaces between items in your comma delimited list. Out of curiosity, does anything that includes ‘Startup Bakery’ happen to work?

---

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 4:27pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/6 "2024-04-17T16:27:29Z")

</div>

In part,

Because what I have is the Name in table “Opportunities”, Name and Opportunity in table “News”

I’m interested in Relation News in table “Opportunities”, made by a relation/query column on table “News”!

It’s more clear?

---

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 4:31pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/7 "2024-04-17T16:31:05Z")

</div>

Yes but only the news with one opportunities name: Startup Bakery!

So if the field opportunities in a news are “Startup Bakery, Sb Lab”, it become empty…

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 17, 2024, 5:29pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/8 "2024-04-17T17:29:42Z")

</div>

I think I’m mistaken. Did a quick test. With a Query, all array items need to match on both sides for the query to return a row. Not just one array item. On the other hand, it does work like you want it to with a Relation column (which is why I thought the Query would be the same). The only downside is that you can’t include your update boolean in the relation.

This feels like a bug with the Query column to me. In my experience, comparing two arrays should return a match if at least one item is in both arrays.

---

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 7:47pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/9 "2024-04-17T19:47:28Z")

</div>

Yes, what I mean…

For you, is there a possibility to “go around” this query error with another layout?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 17, 2024, 7:54pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/10 "2024-04-17T19:54:18Z")

</div>

In the News table, I would create an IF column that returns the ‘split company’ column values only if ‘Investor Update’ is checked. Then replace the Query in your Opportunities table with a Relation that matches ‘Name copy’ to the IF column.

Another alternative is to not create the IF column, but still create the relation by linking ‘Name copy’ to the ‘split company’. Then just set a filter in the collection (if you are only displaying the relation as a collection) to only show rows with ‘Investor Update’ checked.

---

<div class="post-metadata">

**Author:** ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)\
**Post date:** [April 17, 2024, 8:17pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/11 "2024-04-17T20:17:05Z")

</div>

I will follow your suggest.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 24, 2024, 8:17pm UTC](https://community.glideapps.com/t/query-of-a-split-value-in-a-second-split-value/72666/12 "2024-04-24T20:17:44Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
