Duplicate value from Lookup

Hi, I am working on this project, but I dont know what it is going on:

A worker must enter the hours for a machine in the morning and then enter the hours for the same machine in the afternoon. Afterwards, the hours are calculated by subtracting the morning hours from the afternoon hours to determine the total hours worked.

I have a table called Morning Report and another called Afternoon Report.

I created a column that is an array containing today, day, week, month, year, and machine model, and then I established a relationship between both tables through this column. However, when I use a lookup to bring the morning hours into the afternoon report to do the calculation, I get the same value for all records. I don’t understand why—if the relationship between both tables is correct, why am I not able to retrieve the correct morning hours value? some help!! thank you

I wouldn’t create an array for this. Maybe a template column in each table to join the values together and then build the relation using the array. A other alternative would be to just use a Query column which will let you match multiple values.

The reason your array isn’t working is because each item in the array is an individual item instead of a combined value. If at least one of the items in the array finds a matching record in the other table, then that row will be returned. For example, if just Year alone is found in multiple rows, then every row with the same year will be returned. For your use case, an array would make sense only if each array item was the same type, such as multiple years in an array or multiple machine models in an array. Your situation of combining multiple different types of data into an array really doesn’t make sense.

Hi Jeff,

I tried both approaches, but I’m still getting the same value for all rows:

  1. I used a template to connect both tables and then created a relation to bring in the morning hours, but it shows the same value for every row.
  2. I queried the morning table directly to bring in the morning hours, but the result was the same as in option 1.

I’m new to Glide. I watched some tutorials and used an array to find a unique identifier that lets me connect both tables and bring the correct value. Do you happen to have a video or resource with a similar use case to mine?

Thank you!

I found my error, I just changed the value for template column and now I have the right date, thank you

2 Likes