Looker will not be updating this content, nor guarantees that everything is up-to-date.
Author: Mark Stephens
Although Looker does not connect directly to an Excel spreadsheet, there are ways to upload data via a derived table.
First, there is a third-party CSV to SQL Tool with which you can easily convert a CSV file into a SQL UNION ALL
query, and generate a LookML derived table file to copy and paste into the appropriate project. However, if you have security concerns, there is second, more secure, method.
The secondary method utilizes the CONCATENATE
function to create a series of SELECT
statements to ultimately create a SQL based derived table. This method works only if you have a limited number of columns and rows, such as monthly forecasting data, and is not very scalable for large spreadsheets. This method is also static and will not automatically update if the underlying spreadsheet data changes.
The following example highlights how to implement the second method described above.
For example, we have some simple forecast data by month and region:
Using the CONCATENATE
function, we can create SQL SELECT
statements to generate a table.
The first line would be a simple SELECT
clause, and the subsequent lines would UNION
each row as a new SELECT
clause.
Line 1 would look like:
=concatenate("select ","'",A2,"' as month, '",B2,"' as segment, '",C2,"' as forecasted_value")
Then, each subsequent line would look like:
=concatenate("union select ","'",A3,"', '",B3,"', '",C3,"'")
The resulting SQL statement becomes:
We can then paste this SQL into SQL Runner to generate a table:
Subsequently, using Looker's Add to Project option, we can create a view file in our project:
Looker creates dimensions from each column in the table. This new view file can then be joined into an Explore as needed.
Note that there are some caveats around this process:
type: string
. Any dates or numbers may need to be converted into their true data types.You can use the Skyvia cloud platform to connect Looker to CSV. It is a freemium app with no code.
Read more here