Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tableau study group - 4

Tableau study group - 4

Ec2696b240887e40b010e6423d742248?s=128

Alberto Lusoli

January 13, 2021
Tweet

Transcript

  1. study group

  2. Why using Calculations? Calculations allow you to create new data

    from data that already exists in your data source, as well as perform computations on your data. This allows you to perform complex analyzes and add fields to your data source on your own and on the fly. You want to quickly categorize data.
  3. Table Calculations

  4. Row calculations Row-level calculations, also known as record-level calculations, operate

    on every record in the underlying data.
  5. Row calculations To create a new Calculated Field you can

    either right-click on the Data Panel in your Worksheet and select “Create Calculated Field”…
  6. Row calculations …Or create a new calculated field on the

    Data Source panel, by right clicking an existing field and selecting “Create Calculated Field”. In both cases your new calculated field is added to your Data Source and can be used across views.
  7. Functions Calculations are combinations of one or more Functions and

    one or more Dimensions/Measures. Functions are built-in formulas. They can be: Numerical Logical Textual (string) Date Conversions Aggregations Users Table
  8. Example Let’s create our first calculated field. We want to

    classify our “keywords” into 2 categories. Each category identifies the position of the keyword in the Book The 2 categories are: Beginning: If the keywords appears before page 200 End: if it appears after page 200
  9. Anatomy of a calculation In order to create this new

    calculation, we need to mix Numerical and Logical functions
  10. Anatomy of a calculation In order to create this new

    calculation, we need to mix Numerical and Logical functions
  11. The results If the calculation is correct, the new field

    can be found in the Data Panel and in the Data Source sheet.
  12. Doing more complex calculations Functions can be used in sequence,

    can be nested and combined. Based on the previous example, let’s try to classify our keywords into 3 groups: Beginning (1-100) Middle (101-400) End (401+)
  13. Calculating depth in Photoshop Let’s suppose we want to create

    a new field which indicates the “level” of each row in our dataset. Where: Keyword: Depth = 1 Sub keyword: Depth = 2 SubSub Keyword: Depth = 3
  14. Calculating depth in Photoshop Let’s suppose we want to create

    a new field which indicates the “level” of each row in our dataset. Where: Keyword: Depth = 1 Sub keyword: Depth = 2 SubSub Keyword: Depth = 3
  15. Calculating depth in Photoshop Let’s suppose we want to create

    a new field which indicates the “level” of each row in our dataset. Where: Keyword: Depth = 1 Sub keyword: Depth = 2 SubSub Keyword: Depth = 3
  16. Syntax It is not necessary to remember the syntax of

    all functions. Tableau function editor provides instructions and examples. In addition, you can find detailed explanations of all functions here: http://bit.ly/functions-explained
  17. Table Calculations A table calculation is a transformation you apply

    to the values of a single measure in your view, based on the dimensions in the level of detail.
  18. Table Calculations For any Tableau view, there is a virtual

    table that is determined by the dimensions in the view. This table is not to be confused with the tables in your data source. Specifically, the virtual table is determined by the dimensions within the “level of detail,” which means the dimensions on any of the following shelves or cards in a Tableau worksheet:
  19. Table Calculations To simplify: A table calculation is a calculation

    which cannot be executed with the information available in one row alone. It’s a calculation which depends on all the elements which compose our virtual table (i.e. the data table behind a specific view)
  20. An example We want to know how often the term

    “Filter” appears in the “Keyword” field. We want this “frequency” to be expressed in %.
  21. An example In order to calculate the frequency, we need

    to know the “context”. This context is the virtual data table which is behind each view.
  22. Create a table calculation Let’s start from a simple visualization:

    divide the number of records by keywords.
  23. Create a table calculation We can quickly create a table

    calculation using the pre-set functions available in the pills drop down menu.
  24. Create a table calculation Why table calculations cannot have a

    definite value per each row (Go to Tableau sheet 0.5)
  25. Saving calculations If we have created a table calculation using

    the dropdown shortcut, we can save it by dragging and dropping it into the Data panel:
  26. Another table calculation example Let’s plot the number of keywords

    and subkeywords as they have been coded by the analyst.
  27. Another table calculation example Let’s suppose we want to track

    not just where (in which page) and how many times the terms have been coded. Let’s suppose we want to plot the distribution of terms throughout the book.
  28. Another table calculation example Let’s suppose we want to track

    not just where (in which page) and how many times the terms have been coded. Let’s suppose we want to plot the distribution of terms throughout the book.
  29. Another table calculation example Let’s suppose we want to track

    not just where (in which page) and how many times the terms have been coded. Let’s suppose we want to plot the distribution of terms throughout the book.
  30. Tentative outline 1. Intro to Tableau 1. Installing the software

    2. Data sources and reshaping CSV data 3. Tinkering 2. Fundamental concepts I 1. Data – Worksheet – Dashboards – Stories 2. Dimensions and Measures 3. File formats 4. Data manipulation: join, union, blend 5. Fields operations: split, pivot, filter, clean, calculated fields 6. Tinkering 3. Tableau in action 1. Basic visualizations 2. Calculations (Ad hoc calculations, Calculation editor, Table Calculations, ) 3. Data management: extract, live, refresh 4. Tinkering 4. … 5. Dashboards and Stories
  31. For questions or help, write me at: alusoli@sfu.ca THANK YOU