3 Replies Latest reply on Nov 12, 2013 8:19 AM by Matt Lutton

    optimize vis using formulas

    Robert Sutter

      I remember coming across a post that showed how to speed a vis by using lookup to prevent repeat calculation of the same number in formulas.

       

      If anyone has eyes on that post can you please direct me?

        • 1. Re: optimize vis using formulas
          Matt Lutton

          I'm not sure this is still applicable--if it is, I have missed it somehow.  I find Jonathan's blog list to be pretty comprehensive and up-to-date on the topic:

           

          Performance | Drawing with Numbers

           

          Very often, tricks are discovered in Tableau, and in future releases, those tricks are either unnecessary or they don't work anymore.  I'm not sure if this is one of those cases, but I'm interested to learn from someone who does know.

          • 2. Re: optimize vis using formulas
            Jim Wahl

            You might be thinking of PREVIOUS_VALUE().

             

            For example, the WINDOW_MAX(SUM(Sales)) will be evaluated for each row in the partition. By using PREVIOUS_VALUE(WINDOW_MAX(SUM(Sales))), the WINDOW_MAX() calc will be computed just once.

             

            Tableau did fix an issue in v8 with WINDOW_XXX calcs, where the WINDOW was being computed over every row, even if you only wanted the first row, as in IF FIRST()==0 THEN WINDOW_xxx(). The workaround was an along the lines of WINDOW_MAX(SUM(Sales), 0, IIF(FIRST==0, LAST(), 0))).

             

            This is no longer required, but I think the PREVIOUS_VALUE() trick is still a valid optimization, when the value is needed for every row.

             

            Jim

            • 3. Re: optimize vis using formulas
              Matt Lutton

              I understand now, this makes sense.  Very nice, thanks Jim!