1. Have you ever seen some really nice and cute custom shapes and wished you can use them in your own vizzes? I have.

    Yeah, Google search told me that those little shapes are stored in some temp folders with weird names. Once they are found if we are lucky, we have to extract the custom shapes or icons/images into a special folder somewhere (please remind me of the path to Shapes). Then we have to import them into our Tableau Desktop as custom shapes. Quite a hassle!

    Here is a simple way (it applies to Tableau Desktop only, not Public).
    1.Open the viz with shapes of interest in Tableau Desktop
    2.Right click the sheet tab containing the chart with those shapes and copy
    3.Right click a blank sheet tab in your destination workbook and paste
    Now the shapes must be in your new workbook. Check it out to make sure. Create some simple chart with the new shapes and delete the copied sheet. The best way to delete the sheet is to close the data source that comes with the sheet.

    Once you know how to do it, it is as simple as copy and paste.

    Now you can go out and steal some. Try to download this workbook and copy the 3D sphere shapes, which I got from George Gorczynski.
    According to Steve Jobs, Pablo Picasso once said, "Good artists copy; Great artists steal." You might be on your way to becoming great!

    Last but not the least, attribute the creation to the original author in one way or another.
    0

    Add a comment

  2. Natively means no R and no Python is used. We only use Tableau's native functions to do all the necessary calculations, including iterations.

    As I have recently been interested in rendering math functions in Tableau, I noticed a dramatic rendering in Tableau of Lorenz Attractor by George Gorczynski. He used Python to generate the data set, with fixed parameters.

    I tried to implement the attractor in Tableau alone but failed. The problem was that the iterative variables are referring to themselves and to each others. This created circular references that Tableau won't allow. So I let it sleep for a while.

    Later on, I stumbled upon Zen Master Noah Salvaterra's scholarly article on how he solved those iterative calculations in Tableau. What a living proof to "Seek and you will find"!

    Inspired by Noah's article and my interest is rekindled in the dashboard design. Voila it worked! The dashboard is based on 2 rows of data, with parameters. No need of R or Python. It is natively made in Tableau.

    The key is the iterative calculation. Basically, Noah's idea is to create a string that serves as the register of the transient states of an iterative process. All the coordinates and variables can be derived from the state register.

    There are 3 state variables: x, y and z where x, y are coordinates while z is the depth. The format of the string register is x,y;z (all converted in string type). Two different separation characters are used in order to simplify parsing.

    The iterative string will update itself at every step. x,y and z are updated as is shown in George's code:
    x=h*a*(y-x)+x; //Note that x at the right is the previous value.
       y=h*(x*(b-z)-y)+y; //x refers to the new x value in current iteration.
       z=h*(x*y-c*z)+z; //x,y refers to the x,y values in current iteration.
    where
    h=0.008; a=10; b=28; c=8/3;
    The initial conditions are
    x=0; y=10; z=10;
    So the initial string is '0,10;10'. This string is updated using Previous_Value('0,10;10').

    Here is how x is updated:
    • STR(
    • //x= h*a*y_prev+(1-h*a)*x_prev
    • //h*a*y_prev
    • [h delta]*[a]*FLOAT(MID(PREVIOUS_VALUE([IniString]),
    • FIND(PREVIOUS_VALUE([IniString]),',')+1,
    • FIND(PREVIOUS_VALUE([IniString]),';')-1-find(PREVIOUS_VALUE([IniString]),',')
    • ))
    • //+(1-h*a)*x_prev
    • +(1-[h delta]*[a])*FLOAT(MID(PREVIOUS_VALUE([IniString]),1,
    • FIND(PREVIOUS_VALUE([IniString]),',')-1))
    • )
    Then y is updated based on the above x and the previous y. Last z is updated based on x,y of this iteration and previous z. A new tuple is formed in a string like x,y;z. Believe it or not, This calculated field formula is the biggest one I have ever written.

    Details can be found in the attached workbook. Click images to view the workbook.

    That's the key of the computation. It finally helped me understand how Previous_Value() works.

    Here are a few renderings of the Lorenz Attractor. By the way, rendering math in Tableau is a great way to learn some new Tableau skills.
    0

    Add a comment

  3. It seems Tableau doesn't handle big numbers correctly in calculating factorials.

    Here is an example:
    When K<=20, the result K! is good.

    When K>=21 the results are no more correct. Some of them are even becoming negative.

    A case has been submitted to the Tableau support. Click the image to download the workbook.

    [Update] Following comments by Gerardo, I figured out a solution: using Float() in the calculation will give the good result. Click the above image to view the updated workbook. Great thanks to Gerardo!

    Integer operations in Tableau seem performed using fixed point arithmetic, which has limited dynamic range. Floating point arithmetic can entertain a much larger dynamic range.
    2

    View comments

  4. I was given a hand drawn whiteboard shot. Someone needs a scatter plot with radial references just like that. It made sense to me immediately. In a scatter plot, horizontal and vertical references seem no more enough. I would love to see such a chart in Tableau.
    I know what is needed: polygon in dual axis with scatter plot. But I never did it before. It still took some research and optimizations to make it work. Bora Beran's blog is a great source of inspiration to me in my research.

    1.Data preparation
    To add radial references, we need to prepare your data first. That is, add a few rows to the data set. This can been done by Union in SQL.

    Assuming we want 3 reference arcs, then we need 6 rows or 2 rows per arc. The 2 rows designate both start and end points for each polygon-based arc. Here we will use 102 points for each polygon. 102 points seem enough to make the arcs look smooth. More points can be added if necessary.

    Note that there is a Reference column in the table which labels rows for arcs and data.
    2.Drawing Arcs
    This will use the data densification technique native to Tableau. The main steps are:
    - create bins based on [Path] with step size = 1. This will create potentially102 bins.
    - drag Path bin to Rows
    - right click Path bin on Rows and select Show Missing Values.
    - select Polygon as data mark
    - drag Path bin to the Path shelf in Polygon data marks.

    Then create coordinates for the arcs.
    - X Arc and similar for Y Arc
    - Drag X Arc to Columns and Y Arc to Rows. Both are table calculations. Make sure they are calculated along the Path bin dimension. We should see the arcs.

    3.Creating the Scatter Plot
    Use X and Y and the plot is easy. Dot Size can be any measure that will show in the size of each dot.

    4.Dual axis both Arcs and Scatter Plot
    We need to have a single horizontal axis variable for both charts. Here is X All:

    • IF ATTR( [Reference] )='Data' THEN ATTR( [X] )
    • ELSE [X Arc]
    • END
    Note that we have to move X to the Details shelf in the scatter plot's marks card. This is necessary to display all the dots. Make sure X is a dimension by right clicking it. Also Y has to be a decimal type in order to sync with the other axis.

    Voila, it's basically done.
    Click the image to go to the interactive version.

    5.Parametrization
    Note that we use one parameter for each arc's radius. The radius can be changed to any value.

    The number of points for an arc can also be a parameter. Here we just use a fixed number: 102.

    There seems that the number of arcs can not be parametrized. We need to define the number of arcs a priori.

    6.Generalization 
    We assumed that the scales of both X and Y axis are the same. In some cases, this may not be true. Then an arc may not be a quarter of a circle. Instead, it is part of an ellipse. If that's the case, we have to calculate the coordinates differently.

    7.Use cases
    Forrester Research has been using scatter plots with radial references for years. Check them out: https://goo.gl/oJZ6p7

    11

    View comments

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.