Hi all,
Using Make, Airtable and an API, I built an automation that scrapes reviews of a cultural event from Google Maps. On Google, the date on which a user left a review is not given. Instead, Google provides us with a time period that matches the amount of time that elapsed since the user left his/her review (e.g. 'one year ago'). This type of data does not make it easy to sort reviews in a chronological order. Consequently, I went about transforming this type of data into dates.
For this data conversion, I created intermediary fields – Time Unit Count, Time Unit Type and Search Date – that I then combine in a formula in the Date field. But I'm unsatisfied with 2 of those intermediary fields' formulas.
1. Time Unit Type field: for this field, I used a series of nested IF statements because I didn't manage to use the SWITCH function properly in this use case. This gives me a long and not-very-clear formula.
Would any of you guys have a more elegant solution to suggest?
2. Time Unit Count field: as for this field, I simply didn't manage to use the SWITCH function so that I could get a formula along the lines of "if {Date (Raw)} contains 'day' or 'days', then extract what lies nefore; if {Date (Raw)} contains 'week' or 'weeks', then extract what lies before; etc. ".
Do you guys know how to solve this?
I would appreciate your help on this.