• Apprendre

    A propos des cours

    • Quiz, tests, exam, questions
    • Cours
    • Niveaux d’adhésion
    Tableau Server Certified Associate 2022 | SCA C01 Exam

    Tableau Server Certified Associate 2022 | SCA C01 Exam

    Gratuit
    Read More
    dashboard
  • Ressources
    • Quiz, tests, exam, questions
    • Plan d’abonnement
    • A propos de nous
  • Blog
  • Contact
    Vous avez une question?
    contact@innovation.ma
    S'inscrireLogin
    Innovation & data-driven
    • Apprendre

      A propos des cours

      • Quiz, tests, exam, questions
      • Cours
      • Niveaux d’adhésion
      Tableau Server Certified Associate 2022 | SCA C01 Exam

      Tableau Server Certified Associate 2022 | SCA C01 Exam

      Gratuit
      Read More
      dashboard
    • Ressources
      • Quiz, tests, exam, questions
      • Plan d’abonnement
      • A propos de nous
    • Blog
    • Contact

      Advanced

      Accueil » Blog » Data visualisation » Learning dataviz » How to easily make a Sankey diagram on Tableau?

      How to easily make a Sankey diagram on Tableau?

      • Categories Advanced, Learning dataviz
      • Date 1 mai 2020
      • Comments 0 comment
      sankey chart

      At the beginning, I would like to note that this article is inspired by the article Theinformationlab.co.uk which provides the detailed steps for building a Sankey diagram. Before sharing this article I wanted to produce and reproduce this type of diagram in order to ensure the clarity of the steps provided below, without losing this with the tedious tasks of data preparation.

      You have to create 20 calculations in order to successfully complete your diagram. You are ready ? Go for it !

      1. Creation of navigation dimensions and measures

      First create 2 whole parameters with a list of values to be able to select the dimension to analyze:

      • Select Dimension 1
        Select Dimension 2

      Dimension 1

      CASE [Select Dimension 1]
      WHEN 1 THEN [Region]
      WHEN 2 THEN [Category]
      WHEN 3 THEN [Sub-Category]
      WHEN 4 THEN [Segment]
      WHEN 5 THEN [Ship Mode]
      END

      Dimension 2

      CASE [Select Dimension 1]
      WHEN 1 THEN [Region]
      WHEN 2 THEN [Category]
      WHEN 3 THEN [Sub-Category]
      WHEN 4 THEN [Segment]
      WHEN 5 THEN [Ship Mode]
      END

      Chosen Measure

      [Sales]

      2. Creation of data densification frames

      Path Frame

      IF [Chosen Measure] = {FIXED : MIN([Chosen Measure])} THEN 0 ELSE 97 END

      Path Frame (bin)

      Créer un bin pour la mesure “”Path Frame”” 

      3. Calculations creation: Index, T, Sigmoid and Sankey arm sizing

      Path Index

      Index()

      Ceci est calculé le long de Path Frame (bin) et permet de calculer à travers Path Frame.

      T

      IF [Path Index] < 50
      THEN (([Path Index]-1)%49)/4-6
      ELSE 12 - (([Path Index]-1)%49)/4-6
      END

      Sigmoid

      1/(1+EXP(1)^-[T])

      Sankey Arm Size

      SUM([Chosen Measure])/TOTAL(SUM([Chosen Measure]))

      il permet de calculer la taille en pourcentage de chaque branche Sankey  /total data

      4. Creation of high line calculations

      Max Position 1

      RUNNING_SUM([Sankey Arm Size])

      Max Position 1 Wrap

      WINDOW_SUM([Max Position 1])

      Max Position 2

      RUNNING_SUM([Sankey Arm Size])

      Max Position 2 Wrap

      WINDOW_SUM([Max Position 2])

      5. Creation of line calculations at the bottom

      Max for Min Position 1

      RUNNING_SUM([Sankey Arm Size])

      Min Position 1

      RUNNING_SUM([Max for Min Position 1])-[Sankey Arm Size]

      Min Position 1 Wrap

      WINDOW_SUM([Min Position 1])

      Max for Min Position 2

      RUNNING_SUM([Sankey Arm Size])

      Min Position 2

      RUNNING_SUM([Max for Min Position 2])-[Sankey Arm Size]

      Min Position 2 Wrap

      WINDOW_SUM([Min Position 2])

      6. Creation of the “”Sankey Polygon”” calculation

      Sankey Polygons

      IF [Path Index] > 49
      THEN [Max Position 1 Wrap]+([Max Position 2 Wrap]-[Max Position 1 Wrap])*[Sigmoid]
      ELSE [Min Position 1 Wrap]+([Min Position 2 Wrap]-[Min Position 1 Wrap])*[Sigmoid]
      END

      7. Creation of the view

      • Add Path Frame (bin) to the Rows:

      • Check if “”missed value”” is selected

      • Move Path Frame (bin) to detail, add
      • Dimension 1 and Dimension 2 to detail.
      • Put T in the Columns and calculate the (table calculation) through Path Frame (bin)
      • Change the mark type to Polygon
      • Add Path Index to the “”Path”” and calculate the (table calculation) through Path Frame (bin)

      8. Addition of Sankey polygon

      • Add “”Sankey Polygons”” to “”Rows””.
      • Put Dimension 1 in “”Color””
      • Add the “”table calculations”” below for Sankey Polygons (you must change in the “”Nested calculation”” drop-down list after each verification in order to modify the calculation concerned.

      9. You will have your Sankey!

      At the end, you made your Sankey diagram. You can display the 2 parameters previously created in order to customize the result.

      Add at the end 2 other views:

      • a view which displays the measurement concerned (dirty in our case) according to dimension 1 using a bar diagram
      • a view that displays the measurement concerned (dirty in our case) according to dimension 2 using a bar diagram

      Thereafter, you can create a dashboard which combines the 3 sheets horizontally, I invite you to download this work from Tableau public Datadictos in order to assist you.

      NB: Do not forget to check the sorting on each dimension used.

      • Share:
      author avatar
      admin

      Data analysis, BI and Data visualization are my passion. Over 16 years of experience working with various business owners and operational teams, I have the ability to meet expectations and drive insights in agile manner.

      Previous post

      Are you unhappy with Morocco public services ?
      1 mai 2020

      Next post

      Comment réaliser facilement un diagramme Sankey sur Tableau ?
      1 mai 2020

      Leave A Reply Annuler la réponse

      Vous devez vous connecter pour publier un commentaire.

      Recherche

      Catégories

      • Aide à la décision (3)
      • Business Intelligence (3)
      • Data visualisation (6)
        • Learning dataviz (5)
          • Advanced (1)
          • Fondamental (3)
          • Tips (1)
      • Decision making (2)
      • learning (5)
        • Innovation (5)
      • Quiz (7)
        • Business Intelligence (2)
        • Power BI (2)
        • Tableau Software (3)
      • Quiz en (5)
        • Business Intelligence (1)
        • Power BI (2)
        • Tableau Software (2)
      • Tableau Software fr (1)
      • Visualisation de données (17)
        • Apprendre la data viz (8)
          • Astuces (1)
          • Avancé (4)
          • Fondamental (2)
          • Vidéo (3)

      Derniers Cours

      Tableau Software : Fondamental

      Tableau Software : Fondamental

      د.م.290,00 Gratuit
      Préparation à la certification Tableau Desktop Specialist & Certified Associate

      Préparation à la certification Tableau Desktop Specialist & Certified Associate

      Gratuit

      Power BI exam, certification preparation

      Gratuit

      Company

      • A propos
      • Blog
      • Contact
      • Devenir Formateur

      Links

      • Cours
      • Events
      • Gallery
      • FAQs

      Support

      • Documentation
      • Forums
      • Release Status

      Recommend

      This web site is designed by Datadictos. Powered by innovation.ma.

      • Privacy
      • Terms
      • Sitemap

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now