We can use the label clause to add column headers to the data without modifying the original sheet. For example, if we have this source data:
Using the following query...
label A 'State Name', B 'Year Recorded', C 'Language', D 'Original Word', E 'Notes'
... place it in Google Sheets' QUERY function with the format...
... we get the following result:
Replace column header using label clause
The same query can be used to replace existing column headers in your new copy of the sheet. If we have the following sheet…
And, we want to replace the headers with different names (from state name to state, from year first attested in original language to year, from language of origin to language, from word in original language to word, and from meaning and notes to notes), we can set the following query:
label A 'state', B 'year', C 'language', D 'word', E 'notes'
With this, we'll have to place it in Google Sheets' QUERY function with the format:
And the result looks like this:
Can we use the label string as a pointer in queries?
Does it feel a bit inefficient? What’s certainly more inefficient is having to spend long hours coding this when you could, instead, do it all in a couple clickec.If you want to be more efficient, consider trying Lido. With a few clicks on your laptop, you can now access all the relevant metrics without going through the hassle of accessing the SQL databases of your eCommerce platforms and then coding the formulas to process them. Let our platform do it all for you!
Suscribe to get more data and analytics tips!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.