Skip to main content

Posts

Looker filter made with an OR statement

I needed to write a filter that used an OR statement to pull the department values from one explore join (the IN part of the referral) OR the another explore join (the OUT part of the referral).  Unfortunately, this functionality just doesn't exist in Looker. I had to find another way. Here's my explore with 5 joins. The last join contains the OR statement: the final solution to this problem. The first 4 joins set up the in and out assignment of departments for both the referral and the revenue from the referral. explore: flatfile {   join: referred_to_dept {     view_label: "referred to department"     from: v_dim_dept     type: left_outer     relationship: one_to_one     sql_on: ${flatfile.referred_to_dept_id} = ${referred_to_dept.branch};;   }   join: referrers_dept {     view_label: "referrer department"     from : v_dim_dept     type: left_outer     relationship: one_to_one     sql_on: ${flatfile.referrers_dept_id} = ${referrers_dept.branch};;   }   jo
Recent posts

Fix Axis Labels in Bar Chart

Each bar is created with a separate dimension, because the periods we are tracking overlap. The problem is that in the data table, the periods repeat, which creates a weird Axis Value Label, Figure 1. Workaround with not-great results. To fix, add a Table Calculation to the data in Looker and hide the dimensions that were making the weird axis value labels in Figure 1. Axis Label if(length(${dim_week.4_week})>1, "4 week",   if(length(${dim_week.13_week})>1, "13 week", "YTD"))

Hyperlink with multiple liquid filters forcing a value

How can I use a series of cascading filters in a dashboard and allow some of them to take a value in the liquid variable hyperlink, while some filters allow null values? The first dashboard a user visits in a series of 4 has 13 separate filters. Once chosen, those filters need to affect the next dashboard my user visits - so they won't have to re-choose their department and week of interest over and over. We also wanted icon tabs to link to the next page/dashboard. Those tab icons are built as LookML dimensions that carry the hyperlink with filters for that dashboard. I've used liquid variable filters with 2 values but never with this many. It was a challenge and required some time chatting with Looker support. Initially, the filters were forcing a value into each of the 13 available instead of leaving nulls where no filter value was set. The week filter is my original liquid filter methodology, and the others are done in such a way that they don't force a value entry.