Tag: Tableau Calculated Fields

  • String Calculations in Tableau

    Concatenation, Conversion, Analysis and Extraction –
    44 Formulas to work with Strings in Tableau’s Calculated Fields

    NY Mag Crossword - Photograper: Lori L. Stalteri (flickr.com)“String Calculations” is a somehow weird expression. Calculations on texts sounds like a contradiction in terms.

    Of course you do not really calculate strings. You manipulate and analyze them like concatenating texts, changing texts (e.g. to upper, lower or proper case), converting texts or parts of texts to numbers or dates, extracting parts or analyzing them (e.g. how many words or do they contain a number), etc.

    If you do not have the option to do this type of things directly in your database, you will use Calculated Fields in Tableau Software to get what you want from the text dimensions in your data source. That’s why I called this post String Calculations in Tableau.

    Today’s post contains a set of 44 more or less practical examples of concatenation, conversion, analysis and extraction of texts. I will not go into the basic string functions of Tableau, like LEFT, FIND, LEN, REPLACE, etc. You can easily look up how they work in the manual or read the explanations directly in the Calculated Field editor.

    I rather tried to pull together a small library of 44 more complex formulas you may find useful when you have to work with strings in Tableau, like concatenate strings and a date, convert a string to a date, reverse words in a string, extract parts of a string, remove line feeds, check if a string contains a number, count the number of words in a string and many more.

    The article lists and explains all 44 formulas. I do not delude myself into believing anyone would read today’s article from start to finish. It is more a reference type of post and this is on purpose.

    However, I recommend having a brief look inside, even if you are not looking for a certain string calculation in Tableau at the moment. I am starting the article with a little text visualization example and I am also providing a Tableau packaged workbook (on Tableau Public ) including all examples for free download at the end of the post.

    (more…)

  • Dynamic Hierarchies with Tableau

    How to add dynamic, interactive hierarchies to your Tableau Dashboard

    The second article of a guest post series on “Expand your Reach in Tableau with Parameters”

    Confirming the hierarchy / Photographer: patries71 (flickr.com)This is the very long expected continuation of a guest post series by Sheel Bhatiani, Lead Software Developer at Cheyne Capital. We started Sheel’s series already back in November last year, but ever since I left you waiting. Please blame it on me, it is not Sheel’s fault. It is my bad. When starting the series, I have simply bitten off more than I could chew and I didn’t find the time to do the final editing and to publish the next article.

    However, better late than never. The wait is over and here is Sheel’s second post. Enjoy.

    My first post Dynamic Sorting with Tableau introduced a technique to expand your reach in Tableau. One Parameter combined with one Calculated Field enables you to add an interesting additional feature to an interactive dashboard: let the user decide the sort criterion and the sort order for a selected view.

    Today’s second article of my guest post series “Expand your Reach in Tableau with Parameters“ will use a similar technique for adding a similar interactive feature: let the user decide which hierarchy shall be shown in a view. Again, the post includes the background, a detailed step-by-step tutorial and the dashboard for direct interaction here or the option to download the workbook via Tableau Public.

    (more…)