dev3lopcom, llc, official logo 12/8/2022

Connect Now

Are you trying to write faster calculations in Tableau Desktop?

Or are you interested in optimizing your calculations for improved speeds in Tableau Desktop?

You’re in good company. Dev3lop is an advanced analytics consultancy, that started our business helping one client with Tableau Desktop.

Our article is here to assist you in:

  1. Enhancing the performance of your dashboards.
  2. Simplifying the support process.
  3. Ensuring that even the next data expert won’t find it too daunting.

To excel in quick calculations, it’s essential to identify and address slower ones.

#1 Problem with Slow Tableau Workbooks

Solving slow Tableau workbooks is often a calculation optimization game.

Then the migration of transformations, boolean style calculations for example are easily pushed to SQL because SQL does boolean logic with ease, so why make Tableau do this for you? This is a subtle win and as you continue you’ll find bigger wins in our blog below.

Think of Tableau as a tool you don’t need to over complicate. You can protype, transform, build a data product, and then stress about the “improvements” we discuss below in the near future.

Stressing these tiny details now will slow down your project, and stress out business users. Do it when no one is looking or when someone asks “why is this slow?”

During Tableau Consulting engagements, we see it’s easy to move your slow moving calculations into your database after the prototyping phase, and consider pushing heavily updated calculations to your SQL end the hardening phase that you do at the end. Anyhing being changed often is best to keep in your Tableau Workbook until everyone has completed their apples to apples.

Slowest Tableau Calculations to Fastest Tableau Calculations

SLOWEST CHOICE

if month(date)>=5 then “orange”

elseif month(date)<=4 then “blue”

else “filter out”

end

// you don’t need to tell an extract to keep track of a lot of strings because it makes everything slower, it makes the extract bigger, and it isn’t going to help complex workbooks or large data sets. it will actually hurt the workbook if they want to ‘FIND these colors’ for later aggregation, which is generally always the case as they advance in their skills. also, this generates a lot of STRING manipulation in aggregation at a later date. Which generates super slow workbooks for no reason.

SLOW CHOICE

if month(date)>=5 then “blue”

else “orange”

end

// else isn’t necessary and 2 strings is slow.

SLOW-ish CHOICE

if month(date)>=5 then “blue”

end

// else converts to NULL vs asking the app to write ORANGE.

A LITTLE FASTER:

(using comments to explain what things need to be)

if month(date)>=5 then 1 //blue

elseif month(date)<=4 then 2 //orange

else 0 //filter out

end

// this is a step in the right direction, requires a lot less pain in the future because you’re teaching them to use INTEGERS which databases prefer over STRINGS because there’s only 0,1,2,3,4,5,6,7,8,9 choices, where strings have HUNDREDS of choices, and you’re asking the database to effectively work more than necessary and complicating the calculations.

A Faster Tableau Calculation

if month(date)>=5 then 1 //blue

else 0 //orange

end

// just typing numbers, and commenting out strings would make this scalable for complex workbooks and bigger dataz.

Pretty dang fast.

month(date)>=5

// boolean flag.

Write fast calculations in Tableau Desktop and grow the community!

Writing fast calculations in Tableau Desktop is important for user adoption. Also, it will help grow the community to become great at native tableau desktop features. Eventually calculations need to be optimized – and this can be very complex in the future if there are hundreds of slow calculations.