Most programs like Excel, Tableau, Microsoft SQL Server and Alteryx have a built in Date Difference (DATEDIFF) function. This function is great at letting you set a unit of measurement (i.e. year, month, day) and calculate the difference between a start and an end point.
I was working with a client recently and needed to do find and replace in a Tableau calculation. While Tableau does have a native FIND() function, it just finds if a character string exists and tells you what position that string starts at. Not particularly helpful when it comes to replacing.
A client recently challenged me with the question, “How could I show a bar chart in Tableau that shows values for the top 10 displayed as 10 individual bars but group all the rest of the values into a single bar called “other”…
If you're familiar with Level of Detail expressions in Tableau, you probably know that the FIXED function gets all the love. However, there are some great reasons to consider using the other two as well. Check out the above video to learn when to use the EXCLUDE function.
Imagine you have a busy worksheet in Tableau that looks like this:
Each line represents a single facility and displays that facility’s overtime hours. Imagine you want to filter to only keep the trends for the 3 facilities with the highest overtime hours from the most recent date BUT you also want that filter to be dynamic so when you update the data there might be a new top 3.
If you have a data set that updates irregularly, figuring out how to filter to show only the latest data is difficult. Relative Date Filters are great but only work well if you have a set time you are filtering to like “today” or “yesterday”. If your latest data could be today, yesterday, or two days ago depending on the refresh schedule, things get trickier.
Let’s say you want to compare a value from today to the same day last year to evaluate performance…
Creating calculated fields in Tableau Prep is pretty straightforward. Editing them isn’t. The first time I wanted to edit a calculated field in the product I had a moment of hesitation.
I have worked with a number of educational institutions, What I’ve found about those institutions, and many other organizations, is that many of them customize the way they track data over time. With a school it might be by trimester, with a restaurant chain it might be by period (there are 13 per year). These types of date fields require customized calculations.
“How do you calculate a headcount at a moment in time when you only have a start and end date?” I’ve gotten this question several times. My answer used to be “Ideally, you’d want a row of data for an individual for every possible date unit you’d want to count them at.”