Sep 17, 2018 02:48 PM
Hello,
I am trying to take an old spreadsheet with a lookup formula into Airtable.
The base will be used to log issues at each location. Each issue is assigned to a contractor to fix.
While most of the contractors are the same for each issue across locations, some, issues are fixed by another contractor at some locations.
For example:
Site A , B & D - Door contractor is Company A
Site C, E & F - Door contractor is Company B
I would like a field in the main table to updated with the name of the contractor for the issue and location.
I am guessing I would need an IF function with AND OR statements although I suspect this is going to get very long.
Fields are Issue and location.
I am not sure how to write this?
Many Thanks,
C
Sep 17, 2018 02:51 PM
Do you have your contractors listed in a separate table from the “Issues”?
Sep 17, 2018 02:54 PM
Hi,
Yes, I have a separate contractor table and then a location table.
Sep 17, 2018 03:17 PM
Ok – so by default in Airtable, there is not a way to automate the linking of records, and linking is the way you would have to connect a contractor with an issue at a location, since they are in separate tables.
I assume what you are wanting to do is this:
I can see 3 options for you to do what you’re wanting:
SWITCH(
Location,
"A", "Contractor A",
"B", "Contractor A",
"C", "Contractor A",
"D", "Contractor B",
"E", "Contractor B",
"F", "Contractor B"
)
SWITCH()
formula to pull its contractor from the appropriate lookup field given the matching condition, rather than using straight text as I did above:SWITCH(
Location,
"A", {Lookup Location A},
"B", {Lookup Location B},
"D", {Lookup Location D},
etc...
)
So what are the benefits of Option 3? What is the flexibility it provides? Well, supposing in the future you change contractors… with this “Schedule” table, you can create a New schedule, placing the new contractor in the appropriate fields, and begin linking all future records to this new schedule, rather than the old one. All future records will now pull the new contractor name in for the appropriate locations, rather than the old on, but importantly, all OLD records will remain unchanged, still showing the work that was done by the previous contractor, since they are still linked to the old schedule.
If that’s not clear, I’ve explained this “Schedule” concept in the context of a “Pay Schedule” elsewhere:
As I said, the main advantage is the avoidance of mutating historical data, which you do not get if you use option 2 and then change the contractors I the formula down the road.
Hope that helps!
Sep 18, 2018 03:24 AM
Hi Jeremy,
Thank you so much for your in depth reply/solution. I will look into this.
I assume that I would just need to repeat for each issue at each site as each issue is assigned to different contractor at each site.
Site A - Oven Issue (Contractor 1)
Site A - Door Issue (Contractor 2)
Site B - Oven Issue (Contractor 3)
Site B - Door Issue (Contractor 2)
Kind Regards.
C