BOT's #1: Adding dynamic images to your Google Data Studio report
Adding images to your Google Data studio gives it light and takes your visualization to another level. There are several reasons you’d wish to add dynamic images to your GDS report. To explore but a few, the use cases could be in financial data for example when you want to rank your top clients by revenue generated, a name shown to rank the clients might not be enough and in such instances, you can add the client's logo.
Other cases are in reporting on your products, for example, if you wanted to rank your top product category the visualization with an image could make your report easier to digest. With the easy steps in this article, you can pick ideas on how to add the image to your existing and future Google Data Studio report.
In this demo scenario we have tried to rank and categorize the global 2000 companies as at the end of May 2019 by years active, the number of employees, sales value, profits, assets, market capital, and by the country with most companies. It is in the country ranking that we added the country flag as part of the visualization for this demo.
Create your Google Sheet and scrape image URL’s
Check the Ranking_Mid_2019 tab column L. I took time to scrape this data from multiple public databases/sources in Forbes, WikiCommons, and a few others. As a best practice always ensure that your non-calculated data especially those you plan to merge are placed in separate tabs and you can label these tabs with an extension of RAW to clarify its raw data. Having your data this way is like when you are using tables in the more advanced SQL databases and it really helps clarify the data you are dealing with.
To import the data from the RAW data tab in this case "Coutry_Flags&Codes_RAW” into the "Ranking_Mid_2019” tab (see image below), I used the VLOOKUP Formula with multiple indexes "{2,3}” to return both the Flags and Codes which had a separate purpose in my demo report. If the LOOKUP is TRUE, with the ARRAYFORMULA nesting the VLOOKUP, values should return for all instances in the column.
Here is the formula in L1:
=IFERROR(ARRAYFORMULA(IF(LEN(K:K),VLOOKUP(K:K,'Coutry_Flags&Codes_RAW'!A:C,{2,3},0),"")))
Note: Some images might not display in Google Data Studio because of copyright concerns. I’d recommend using images with creative commons licenses preferably those from WikiCommons.
Adding your data source and calculating your image field in Google Data Studio
Once you have your spreadsheet well structured in the schema readable by Google Data Studio. Your next step is to go to Google Data Studio and start off creating your report. You can do this by selecting the Data Source as Google Sheet, then the spreadsheet you want to use as a database, the specific worksheet, or one that is acting as our table for the sake of reporting.
With the above step complete, you should see the image below:
One thing you’ll notice in the “Field = Flag”, the adjacent “Type = URL” which is TRUE because we have URLs in the data column for Flag.
From this field, we can then derive our calculated value for the image we want to display on our Data Studio report. To do this, on the top right corner of the field open pane, click on ADD A FIELD when you are done, you should have something similar to the image below.
领英推荐
The calculated field name we opted for in this case is “Flags” and the formula in the image above relates to the HTML image tag below:
<img src=“Image_URL" alt=“Alternative_name_for_the_image"
Image_URL ≡ Flag
Alternative_name_for_the_image ≡ Country>
This brings us to the end of this article. As always, check under resources for the files used in the article or reach out to me in case something is not clear and for general feedback. Cheers!
Resources
About the author
Rogers is a data and emerging tech enthusiast. He is the Co-founder and VP of Operations at OurPass.
OurPass is a global neobank providing businesses of all sizes with access to every banking, payment, and business management tool they need to start, grow and scale their businesses.
Our mission is to create a borderless world of successful businesses and we are constantly building new tools to ensure that whatever stage a business is in, they have access to every tool they need to thrive, all in one place.
Founded in 2021 as a one-click checkout company, we made a pivot in July 2022 when we saw that beyond offering a niche service, we could provide end-to-end solutions that helped entrepreneurs grow every aspect of their businesses.
In just a few months since our transition, we have become a leading business bank serving thousands of customers including some of the biggest retail outlets in Nigeria such as Spar, Shoprite, and Eat N Go (parent company of Dominos, Cold Stone Creamery, and Pinkberry), processing about a million transactions monthly.
OurPass also holds a Microfinance Banking License from the Central Bank of Nigeria.
To unlock limitless smart business banking that OurPass app offers, download the app from the?App Store?or?Google Play Store, create an account, and join thousands of businesses growing with us.
Growth Marketing para PMEs.
3 年Thanks a lot! I'd search this for the entire week if wasn't for you!
Biz Dev at Nollywire
3 年Well done