Looker Connect Training
Help Center
Documentation
Community
Cloud Certifications
It’s common to want to switch between currencies in Looker. This is usually achieved by having your results/table in a base currency, for this example EURO. We can then have a currency conversion table that is joined in and you can convert the base currency to a local currency. Let’s define the currency conversion table in a view called currency_conversion. This will have three columns: Conversion Rate: the conversion from Euro’s to Local Currency Country: this is the country that is joined to the price table Currency Symbol: this is the symbol for the currency, ie £ for GBP view: currency_conversion { sql_table_name: currency_conversion ;; dimension: conversion_rate { hidden: yes type: number sql: ${TABLE}.conversion_rate ;; } dimension: country { hidden: yes type: string sql: ${TABLE}.country ;; } dimension: currency_symbol { hidden: yes sql: ${TABLE}.currency_symbol ;; } } In the view that has our price dimension, we can a
It is common for date/time series tiles in a dashboard to be easily switched between date/week/month etc. This can be done with a parameter and liquid in the LookML. It is good to have a separate view file called parameters.view, maybe saved in a common_views folder, where parameters can be defined. In this example we will create a parameter called timeframe_picker in our parameters.view file. view: parameters { extension: required ##################### # COMMON PARAMETERS # ##################### # Timeframe parameter: timeframe_picker { view_label: "-- Parameters" label: "Date Granularity" type: unquoted allowed_value: { value: "Day" } allowed_value: { value: "Week" } allowed_value: { value: "Month" } allowed_value: { value: "Year" } default_value: "Day" } Note that the view has no sql_table_name, but instead has extension: required. We can then extend this parameter view into other view files instead of having to recreate a timeframe_
Currently, the only was to get a custom welcome email is through the API. Here is a python script that uses the Python SDK that will return the setup urls for all the users that don’t have a Name, ie they haven’t set up there account. This solution still requires Users to be created in the UI, and then just don’t select the send setup email The first thing you need to do is create a Look that has the Name, Email and ID from User Activity. This can be done from your.instance.com/explore/system__activity/user Once this is done, take the Look ID and add it in the code as the users_look_id. In the code below change it from 60! import looker_sdk import urllib3 import json urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) sdk = looker_sdk.init31("looker.ini", "Looker") my_user = sdk.me().email print(f'Authenticated as {my_user}') # CREATE A LOOK IN LOOKER FROM USER ACTIVITY /explore/system__activity/user # IT NEEDS TO INCLUDE USER ID AND USER NAME # SET users_look_id TO
A common way to analyse groups of data is to use the tiers parameter in LookML. This will group a dimension as needed for a given set of tiers. dimension: sale_price { type: number sql: ${TABLE}.sale_price ;; } dimension: sale_price_tiers { type: tier sql: ${sale_price} ;; tiers: [10,50,100,1000] } But you might need your users to be able to choose which tiers they want from the Explore/Look/Dashboard. You can do this using a set of parameters where your user can input their desired grouping (a custom tier). The below LookML does the grouping on sale_price dimension mentioned above. parameter: bucket_1 {type: number} parameter: bucket_2 {type: number} parameter: bucket_3 {type: number} parameter: bucket_4 {type: number} dimension: bucket_groups { sql: {% assign bucket_string_1 = bucket_1._parameter_value | append: "," %} {% assign bucket_string_2 = bucket_2._parameter_value | append: "," %} {% assign bucket_string_3 = buck
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.