Get startedGet started for free

LOD FIXED in practice

1. LOD FIXED in practice

We continue working with the Fitbit dataset as we explore the world of LOD expressions in practice. In this video, we will zoom in on the FIXED expressions. Before we start working with the dataset, it is very important to understand its granularity. In this exercise, we have two datasets: The Fitbit user master data and the Heart rate usage data. If we prefer to look at a sample of individual records, the trick is to click here on this icon – View Data. A small window will pop up, this way, we can now inspect the underlying data sources. Let’s have a closer look at our Heart Rate data. Note that we have several time and date dimensions, including a timestamp but also discrete date, hour, and minute. There are quite some fluctuations if you look at the measurements! Let’s visualize this! We will drop the continuous Time dimension to the columns, which is the timestamp of the measurement, and an AVG of Heart rate to the rows. These are some wild fluctuations per minute level! I am curious if despite per minute variance the daily perspective looks as dramatic. Notice that a distinct Day is not present in the canvas. We already have a continuous Timestamp dimension instead, so we will have to FIX our calculation on the Heart Rate Date. We’ll create a new calculation and call it Average HR per Day. Let’s start by typing in the curly brackets, word FIXED, and we’ll also put a colon and aggregated average heart rate. What about the dimension? We want to fix the calculation per day. Let’s go ahead and add Heart Rate Date as a dimension. Let’s add it to the canvas. Note that we cannot sum Heart rates so the appropriate aggregation will always be an Average. Wow! That’s a much smoother curve already! So, despite potential fluctuations per minute, on a daily basis, the HR of our participants is rather stable, this is good news! But actually, I am also curious to see what an hourly chart would look like. As you can guess by now, we will need another FIXED calculation, but we can reuse the previous one. Let’s duplicate it, changing the name to Avg HR per hour. The only thing we are still missing is another dimension, Hour, in the calculation. Note that the order in which we write these dimensions doesn’t matter to the calculation. Now let’s drop it in the canvas. I like this graph a lot! It gives a smoother line, eliminates a lot of outlying measurements but still leaves enough detail to draw conclusions. We’ll settle with that. Over the past few minutes, we’ve been easily computing different average heart rates, navigating across minute, hour, and the day. Note that none of these dimensions is in the canvas. We only have a continuous timestamp in the columns. This is the power of FIXED LOD expressions: it computes a value using the specified dimensions, WITHOUT the reference to the dimensions in the view, aggregating the value only at the dimensions specified. Now it’s your turn to test LOD in practice!

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.