1. I was alerted by an old request in Tableau forum dated year 2012.
    https://community.tableau.com/ideas/1364
    Today I found a solution for it. It needs 5 calculated fields, plus conditional formatting. The solution is based on custom total and subtotals method pioneered by Zen Master Jonathan Drummey.

    We will use the Superstore data as an example, excluding a few subcategories to emulate a single subcategory in a category.

    Here are the steps:

    1. Union the data set with itself in the data source editor

    This will add a new dimension Table Name to the data source.

    2.Create 5 calculated fields

    - Subcategory New
    This adds 'Total' as a Subcategory.
    Sales New
    This will show the equivalent calculation of Grand Total using custom grand total technique.
    Subcategory Label
    This adds 'Grand Total' as a label. Otherwise it will show 'All'.
     - Size
    It is the Size() function. It will be used in the table calculation below.

    - Hide Subtotal 
    This is a filter that will hide the subtotals with a single subcategory. This is a table calculation filter. We need to set Hide Subtotal to calculate along Table Down and set Size to compute along Subcategory New

    Note that we need to set the filter to be True!

    3.Add two columns: green pill Sum(0)

    One is for Sales New. The other is for Subcategory Label. Both are put on the Label card.
    Row dimensions must include Table Name and Subcategory New, and hide the headers.

    Some cleanups include coloring the text, hiding the data marks with zero opacity.

    Here is the workbook. Feel free to download it and improve it.
    3

    View comments


  2. In Tableau text fields, such as text label or tooltips, there is no text wrap option. When a text label is long, we wish we can have it. Here we are going to show that we can make it happen.

    In one project, we have limited space for text labels. That means, we have limits on both width and height. Given that the text label string can be very long, we need to wrap the text around. Since there is no such functionality in Tableau, we have to solve the problem by ourselves.

    First, we need to define the width of the string, namely in number of characters. Second, define the number of rows. Assume each row can accommodate up to 80 characters and there are in total 3 rows. In total, the max number of characters is 240.

    How to implement text wrap? Given a width limit, we will add line-breaks to a long string  at a word that is at the 80 character limit or below. It is important to note that a line-break should be inserted between two words. It is a line-break and not a word-break.

    The key steps are as follows, assuming the width limit is N characters. N can be a parameter.

    1.Take the first N characters of a string using LEFT(String,N) function. Name the above substring Row1.
    2.Find the position of the last space in the Row1. Cut off the chars beyond the last space from Row1.
    3.Repeat the above steps on the rest of the string (without Row1 part) and create Row2.
    4.Create Row3, etc.
    5.Create a label
    Row1+'\n'+Row2+'\n'+Row3
    6.Apply this new string to the Label field.

    Voila.

    Note this method applies when we have a limited space for displaying a long text label.
    9

    View comments

  3. Recently, for the first time I had to connect to an Excel file on a SharePoint site. I was told that by opening Tableau's new data source interface and selecting Excel, I just need to add the URL to the file, such as http://server/site/library/filename.xlsx

    It did work at first! We get all the data etc. Then strange thing happened. The data source won't update by refreshing data source, even when we made changes in the Excel table. By searching around and I found the following articles which are very helpful:

    UNC Path Naming for files stored on SharePoint
    Connecting to SharePoint-Based Excel File

    Here is the solution:
    Instead of using the URL link, we must use UNC link, which is very similar to the URL: just reverse the slash to be back slash (minus http:)
    \\server\site\library\filename.xlsx

    What is going on?
    The culprit is that the http link tends to store the Excel file in a local cache. Then the file content won't get updated as quickly as we wish. UNC link is linked to the original file without any caching.
    0

    Add a comment

  4. In the previous post, we showed how to create bar chart multiples in a single sheet with the same measure. Here we are going to show you how to do this for different measures. Using the Superstore data set, we are going to show bar chart multiples for Sales, Profit and Profit Ratio per Subcategory. It gives a simple summary of leaders and laggards on important measures. The key is to visualize them all in a single sheet à la Tableau Prep.

    Here is the resulting dashboard:
    The design steps are:
    1.Union the Superstore data set (Orders table) 3 times. The resulting data set gets an extra field [Table Name].
    2.Create the following calculated fields:
    -Mixed Measure Names
    -Mixed Measures

    3.Create the worksheet
    Voila, in a single glance, we can view three subcategory measures in sorted fashion. The workbook can be downloaded here.


    0

    Add a comment

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