Currency Exchange Rate Block with Big Query

Knowledge Drop

Last tested: Nov 13, 2019
 

Looker Currency Exchange Block Instructions for Big Query

For more information click here.

Here are some steps on how to set up the Currency Exchange Rate Block with a Big Query connection.

1. Go to Github

Fork the datablocks-exchangerate repo

wRbXUq0KLKPAPHAzyzKr4DnPc5kJrfU3nkn71y7LgO1PcEbWfVFp-naUfXT2tkV9Gu6tWDSsyVcZNbtQ1e7Q3mkKaEABOO3m81KJZoNBx-avZuzZMlsN4aVstp0T00yipU_SSqkO

2. Delete Snowflake files in the forked repo.

Click into the file and then click the trashcan. You can write a commit message if you would like.

3. In Looker go to Manage LookML Project. Create a new project.

nHUVMLje2uuEZkm69RryQaZOHOfbpzNCrs0tzzPY7TnRrdU9Na7cv5sY641gQgMbnFWsAw0z3zCl1ByWKqrfoV-lBLRnSeSI1WTQUJT1BfROnth8lJCR0ERbmfUrYGGRDh3Ap9Nf

Start with a blank project. Set up a GIT connection to the forked repo.

34b2K1wX0Z53HDyI8LBl4SkszAtpRqj_0TZtCBRHPvAbzcjkHf77o9l2Gudeny1rCuIkZN2ji5ZtTSy1Un016k1tq6hVWwLsitNL_wJlwgp41jn7162coziOPgprdlFgAE5WDM4w

Shift-click on the git button and select Pull from production to download files from repo. 

TB9vZ1-XhH5D3DOwyn-gvE1Fs6TNWzI2J5WDA_Zy_v4mSP_-nQY56_9bblVBg0BYVxR5MuG-hDSgeTqYUah3qrvMGPOLt2xBQ6R8fQX18_bPaiIYAVpORwTOnnHhMKgRc2TaAKnU

4. Create a new connection to BQ with PDTs enabled following the steps listed in the instructions here:

Double-check the connection by going to admin → connections → test connections.

**** If you already have a BQ connection with PDTs enabled, skip this step. ****

5. Change the connection name in the model file in the new project to the new connection or existing Big Query connection with PDT access.

jR2E3CER8M8EAVLnpeTj8XM1mN079v9yYaashpAN-L1x5EGrv1vdPrWBo2uG2mhLjwvV4hnZDk7PiEsHBKII8uoPeMMtjblu8lqCzrHePIY_W89AS5lxMO8TBTZD8Y_ZZFiJlG2k

*** You can also create explores for each view file. ***

6. Add a manifest file to the existing (original) project you want to extend the currency data to. You may have to enable the Project Import Labs feature. For more information click here.

Here are some more docs.

The manifest file in the original project should look something like this:

yYCimdQjm1E7R50nUCXCfH1lOZzeeqHdpktjg6U57JqhDMxm_g8EB1RHk5lDB0fyBm_XaxW5xSrPVsVcyaFieinnwHE_LOHwl5K2J-ikZVmL1tJmT8M5x-h9hyTAeoXu4an6G43k

7. Extend the files from the new project to the project you want to collaborate on. Here is the general doc on how to extend files.

In the example, the view files were included in the original project’s model file.

include: "//exchange_rate/*.view"

Then, the views were joined to existing explores in the original project.

For my example, the views were joined on dates.

There can be multiple entries for a date in the bites view. We do not generally recommend joining on dates, but if you do please use the raw date format. For more information click here.

Example join:

explore: bites {

 label: "Dog Bites in NYC"

 description: "List of all bites"

 join: bq_forex {

   type: left_outer

   sql_on: ${bites.date_of_bite} = ${bq_forex.exchange_date} ;;

   relationship: many_to_one

 }

End Result!

1uCqj0tbdtKaqtgN5NTHC_7KIHeyf9isZSWXiUaQVbJ-PuaTY0OdWPh06UwPcrE4CdpFDBeUvtpgGJHuAhII9KqLBv4RpUPw_H1OnYJM7HpeZOP1z5bmCMflWcnP0cP1jxoR4ouF

This content is subject to limited support.                

Version history
Last update:
‎07-07-2021 01:15 PM
Updated by: