# Pulling Unique elements from column into column in another table

**URL:** <https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500>\
**Category:** Ask for Help\
**Created:** [June 6, 2023, 1:40pm UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500 "2023-06-06T13:40:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cerosilva](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cerosilva/32/59819_2.png) [@Cerosilva](https://community.glideapps.com/u/Cerosilva)\
**Post date:** [June 6, 2023, 1:40pm UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/1 "2023-06-06T13:40:06Z")

</div>

HI,

Ok so i have two tables,

Test Orderbook which tracks the parts and their quantities and prices, bought and sold at.  
Test StockBook in which i want to be able to find the current stock balance as well as total item bought and sold itemwise.

Query one:  
I need the unique elements from the part name column in the Order book to auto-populate in the Name column in the Stockbook.

Query Two:  
I then need to use the Rollup option item wise to pull info for the adjoining columns from the orderbook.

 ![Selection_132](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/f/df4cd724289005dd92da2f64a0e6e28a806ec32f.png)  
 ![Selection_130](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/7/b7ea9aa14830a565470bbcf9a9204d9e652e8e88.png)

---

<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:** [June 6, 2023, 2:24pm UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/2 "2023-06-06T14:24:13Z")

</div>

You can do it like this:

- All the below should be done in your Test Stockbook table
- Add enough rows in the table to cover the total number of unique parts
- Start by creating the 3 columns described in the 2nd [use case](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572) in this post.
- The above should result in a column that is numbered starting at 0.
- Now add a Lookup column. This column should target the Part Name column in the Test OrderBook table.
- Next, you need a [Unique Elements](https://www.glideapps.com/plugins/uniq) column. This one should target the previous column.
- Now, a single value column. This one should take “From Start → Row Index” from the Unique Elements column.
- If you’ve done everything correctly so far, you should now have a column that contains a list of unique Part Names. You can now use this column to create a multiple relation back to your Test OrderBook table, matching the Part Names in each table.
- To get the rest of the values:  
– In Stock: not enough information to say. Where is the starting stock level stored?  
– Total Purchased: use a rollup → count via the multiple relation  
– Amt Purchased: use a rollup → sum → Purchase Price via the multiple relation  
– Total Sold/Amt Sold: not sure which columns in the Test OrderBook table should be used for those?

---

<div class="post-metadata">

**Author:** ![Cerosilva](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cerosilva/32/59819_2.png) [@Cerosilva](https://community.glideapps.com/u/Cerosilva)\
**Post date:** [June 7, 2023, 5:48am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/3 "2023-06-07T05:48:10Z")

</div>

Hi Darren,

I seem to be getting stuck at this step.

> [@Darren\_Murphy](#):
>
> Now, a single value column. This one should take “From Start → Row Index” from the Unique Elements column.

I’m adding the screenshots of what I was able to do so far.

This is the over all screenshot of all the columns.

 ![All Columns](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/5/951be946b84b8a189e00324878711558167dee3a.png)

I managed to get the 12 Part names pulled up from the order book.

 ![All Names](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f07f6496f5e943226b8b813d410620fcb1cd2502.png)

And the unique names as well.

 ![Unique names](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/a/8a19c50c391b49f03233451ba7282c51f16e9e8e.png)

But somehow, even though I’ve selected the single value column, it’s still pulling all the unique names again, instead of individually.

 ![UniqueNamesList](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/a/3a7e6d40463d24c5d90b2b65c808a15521242545.png)

If you could see where I’m making an error, I’d be much obliged.

---

<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:** [June 7, 2023, 6:03am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/4 "2023-06-07T06:03:42Z")

</div>

The error is below:

 ![CleanShot 2023-06-07 at 14.01.35@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/f/6ffe5dbc89eae84ebce5dd68714519f04f5ccc47.png)

When you select the “From” value, you should see the Unique Names column listed separately near the top. Choose that instead of Test StockBook → Unique names

---

<div class="post-metadata">

**Author:** ![Cerosilva](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cerosilva/32/59819_2.png) [@Cerosilva](https://community.glideapps.com/u/Cerosilva)\
**Post date:** [June 7, 2023, 6:42am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/5 "2023-06-07T06:42:10Z")

</div>

Ok, got that but there’s a problem.

When i select ‘from start’. it defaults to first. and then show only the first in all the rows.

---

<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:** [June 7, 2023, 6:43am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/6 "2023-06-07T06:43:45Z")

</div>

Yes, it will default to First. But you can change that.

---

<div class="post-metadata">

**Author:** ![Cerosilva](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cerosilva/32/59819_2.png) [@Cerosilva](https://community.glideapps.com/u/Cerosilva)\
**Post date:** [June 7, 2023, 6:49am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/7 "2023-06-07T06:49:31Z")

</div>

How?

I tried it but it’s not refreshing

If i try first, last, from end, it just gives the same in all the rows.

But not in correct sequence.

 ![Selection_137](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/5/d5709a3fb3303976372d3e5f82d5df77c038d7b8.png)

---

<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:** [June 7, 2023, 6:52am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/8 "2023-06-07T06:52:15Z")

</div>

Click on the down arrow next to First, and choose “From Start”

 ![CleanShot 2023-06-07 at 14.51.03@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/e/1eb821f9dffd9050729c11da7b375a4e024622a8.png)

👇

> [@Darren\_Murphy](#):
>
> Now, a single value column. This one should take “From Start → Row Index” from the Unique Elements column.

---

<div class="post-metadata">

**Author:** ![Cerosilva](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cerosilva/32/59819_2.png) [@Cerosilva](https://community.glideapps.com/u/Cerosilva)\
**Post date:** [June 7, 2023, 7:05am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/9 "2023-06-07T07:05:23Z")

</div>

Ah, My bad.

i got it now.

I was not selecting the Row Index as custom and just leaving it at the default 0.

 ![Selection_138](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/3/632fcdc1112ecd93fab6fc6f12c7a56225f03fce.png)

It’s working now.

Sorry for the trouble. 😅

---

<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:** [June 7, 2023, 7:09am UTC](https://community.glideapps.com/t/pulling-unique-elements-from-column-into-column-in-another-table/62500/10 "2023-06-07T07:09:32Z")

</div>

Great 👍

Let us know how you get on with the rest of it.
