<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Filippos Lymperopoulos on Medium]]></title>
        <description><![CDATA[Stories by Filippos Lymperopoulos on Medium]]></description>
        <link>https://medium.com/@flymperopoulos?source=rss-a3d2aefadd88------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OuIITBuT7wGuFb2Z4SSzug.jpeg</url>
            <title>Stories by Filippos Lymperopoulos on Medium</title>
            <link>https://medium.com/@flymperopoulos?source=rss-a3d2aefadd88------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:48:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@flymperopoulos/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Set Control: Relevant Values]]></title>
            <link>https://medium.com/@flymperopoulos/set-control-relevant-values-a7750079e93d?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7750079e93d</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Mon, 11 May 2020 20:52:31 GMT</pubDate>
            <atom:updated>2020-05-11T20:52:31.348Z</atom:updated>
            <content:encoded><![CDATA[<p>The Tableau <a href="https://www.tableau.com/products/new-features">2020.2 release</a> is out and it is packed with awesome new features. But as you’ve probably noticed I write a lot about Tableau Sets, so this is another blog post on the awesome new Set Control available in 2020.2.</p><p>Before 2020.2, the only way a viz consumer could change a set’s membership was via Set Actions. We released Set Actions in Tableau 18.3 and since then our team has been working hard to provide your consumers with new ways to choose what values are in a set. The Set Control is now here and we couldn’t be more excited.</p><p>A couple of weeks ago I wrote a post on some <a href="https://medium.com/@flymperopoulos/set-control-default-trickery-3af4638e3874">advanced default trickery</a> possible with the Set Control. In this blog I will show you how to use the Set Control to display relevant values between many Set Controls. This trick will allow your consumers to ask more relevant questions and save them time during their analysis.</p><h3>Why should I care about relevant values?</h3><p>Turns out is is very common to search for values based on another field’s set of values. Take the Sample - Superstore dataset for example. Scrolling through Sub-Category values to select all but one value part of the “Furniture” Category can be cumbersome. This gets especially difficult when dealing with much larger domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*_ps9YgU6J1IeR0ChkcnLbw.png" /></figure><p>While authors can get around this problem, viz consumers’ options are limited. This blog will show you how you can give that power to your consumers.</p><h3>Sets and Field Relationships</h3><p>Sets allow you study relationships between fields in your data.</p><p>For example, let’s say I have created a set from the Category field using the Sample - Superstore dataset and I want to find all Sub-Category values that belong in the Categories found in my set.</p><h4>Step 1: Create Parent Set</h4><p>We first want to create the “parent set” and call it “Category Set.” This is the set via which we will search and define what becomes available in the subsequent sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ki6GMMnJ_QSBG6IOPKWoow.png" /></figure><h4>Step 2: Create Child Set</h4><p>We now want to create another set based on the Sub-Category field. Only difference here is that we want to condition that set to return only the relevant Sub-Category values based on the parent “Category Set.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HiIP49n1bWQNH5If8nx1w.png" /></figure><p>What is this MAX([Category Set])? Well, because a set is just like an LoD calculation that returns 1 or 0, TRUE or FALSE, you can think of the Sub-Category set as an LoD calculation that look as follows:</p><blockquote>{fixed [Sub-Category]: if max([Category Set]) then max([Sub-Category]) end}</blockquote><p>In plain English this says: at the Sub-Category level of detail, return all Sub-Categories that belong in a Category that matches a value in the Category set. The LoD expression is daunting to read and interpret; the set dialog makes that ugliness go away :)</p><p>With these two simple set definitions, Tableau helped me easily relate values between the two fields and find relevant values based on selection from the parent set. No complex LoD calcs required.</p><h4>Step 3: Show the “correct” Set Control</h4><p>When we display quick filter controls or set controls with conditions, we show them as controls that have all their values checked and the condition at the bottom, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/162/1*bX656KrqVwG9OZSbTRiWXQ.png" /></figure><p>Instead, we want to see the values returned after the condition is applied, and select from those values. We can do this via a calculation and the Set Control feature. To do so, we first have to write a calculation that returns the values in the child set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*LQvjqrwJGHcoMhqYwUnAMw.png" /></figure><p>And from that calculation we will create a new set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQj3vaC-y0ev_8B4N5QpxA.png" /></figure><p>That set will always update to show as its domain the Sub-Category values that are related to the Category values in the Category set, irrespective of the viz level of detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*V26sAKlVcrvAnekbIQXtGQ.gif" /></figure><p>This technique will not <em>select</em> by default all the children elements related to the parent but it will make them available in the set’s domain for selection.</p><h4>Step 4: Use sets in the viz</h4><p>Now using the sets as drivers for size and color, I can interact with control options and the viz updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzO1G9_HPxNEM_Rft0lEGQ.gif" /></figure><p>With the two set controls I am able to search for values that are related across dimensions and apply the values I want to encode the viz.</p><h3>Things to consider</h3><h4>Null</h4><p>You may notice Null as the first value in the Sub-Category control. The Null represents all Sub-Category values not related to the parent set’s selection. Selecting Null will include all Sub-Categories for the unselected values in the Category set. In some ways this can be interesting, as you can effectively toggle the set of Sub-Categories you are asking a question about with a single click.</p><p>You can always rename Null and make clearer what it represents for your consumers.</p><h4>Levels</h4><p>You can imagine that this technique can be used for more than just the relationship between two fields in a data source. For example we can include in this logic a third dimension, i.e. Manufacturer, and avoid searching through all Manufacturer values.</p><h4>Conditions</h4><p>The conditions don’t have to be solely about dimensional relationships. You can also relate fields based on a measure value threshold, i.e. all Sub-Categories that are related to the Category set selection AND have each contributed more than 100k, i.e. MAX([Category Set]) and SUM([Sales])&gt;100,000. It goes without saying that this condition can get arbitrarily complex according to your needs.</p><p>If you have any questions please feel free to reach out. Can’t wait to see what you all come up with using the Set Control feature!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7750079e93d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set Control: Default Trickery]]></title>
            <link>https://medium.com/@flymperopoulos/set-control-default-trickery-3af4638e3874?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/3af4638e3874</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Mon, 04 May 2020 16:58:06 GMT</pubDate>
            <atom:updated>2020-05-04T16:58:06.230Z</atom:updated>
            <content:encoded><![CDATA[<p>I first publicly demo’d the Set Control feature at <a href="https://youtu.be/WWECV_a_aaA?t=3287">Devs on Stage</a> during TC19. It is my favorite feature of the upcoming 2020.2 release, and it is going to be a game-changer.</p><p>Two weeks ago I <a href="https://medium.com/@flymperopoulos/set-actions-add-remove-dd3c1768789">posted a blog</a> discussing the new enhancements coming soon to Set Actions in 2020.2 and ended the post saying:</p><blockquote>With Set Actions and the Set Control we always edit the selected values in the set dialog’s General tab. The same holds true for quick filters, of course, this is no new behavior. <strong>There is, however, one exception to this rule that I will outline in a future blog post!</strong></blockquote><p>In this blog post I will show you that exception. With it you can <em>computationally</em> define what values are selected in the Set Control. In other words, you can define its default behavior to whatever condition you want!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*6k2JAnANWUaONrI8T6Ma5w.png" /><figcaption>Condition and Top clauses can define control selections</figcaption></figure><blockquote><strong>Disclosure</strong></blockquote><blockquote>This method is considered an advanced “hack” trick but a very valuable one nonetheless to be aware of. The Set Control feature available soon in 2020.2 works exactly like all other Tableau controls you have been used to over the years. This blog highlights a mismatch between Tableau’s platform and UI that can be beneficial if someone wishes to explore it :)</blockquote><h3>Background</h3><p>One way to think of sets is as named filters that can be used in calculations. As such, Set Controls look exactly like Quick Filter controls. Both controls are very easy to understand. You select some values and the view updates to reflect information for the selected data values.</p><p>In the case of a conditioned filter or set on the State field, i.e. Top 2 States by SUM(Sales), the control looks a bit different. Instead of showing you the 2 States with the highest sales selected, it shows all State values in the control selected, by default, and the Top 2 condition written at the bottom. Tableau assumes, by default, that you want to look at all State values in the field’s domain (thus all selected) and from all the States find the 2 States with the highest sales values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*TCF-1k4ILKEeLL270nb8zQ.png" /></figure><p>So what happens when I unselect values in the controls above? Tableau updates the selected values in the set’s or filter’s General Tab and then applies the condition to the new set of selected values. For example, if we were to select only 4 States, Tableau would return the top 2 States by Sales from the selected 4. While it is beneficial to programmatically control what values the filter or set will load with when the workbook opens, it is impossible for viz consumers to arbitrarily change that during analysis. <strong>This is problematic, as I can never ask a question about 1, 3, or any number other than 2 States.</strong></p><h4>Feature Improvements</h4><p>Over the years, we have not altered how conditioned controls display or work. We have, however, added more programmatic control in specific scenarios. Discrete Date Default Value Filters (DVF), also known as Filter Presets, is one such example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*QvmZ9hmoi_0J8UWrgrBS9A.png" /></figure><p>The DVF feature, shown in orange above, allows an author to set their discrete date filter selection to the maximum date value in the date field’s domain. As such, it also allows viz consumers to change that to an arbitrary set of dates as they interact with the viz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*-r6kdaTstDVN_vKoObqMgg.png" /><figcaption>Latest date in the data source is 12/30/2019</figcaption></figure><p>Before DVF, authors were able to create a workbook that launches with data for just the latest day/month/year, using the Top tab’s “By field” affordance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*Ls_hnWq7u_VeIbKBf2VAcg.png" /></figure><p>Doing so, however, resulted in a control on which viz consumers were unable to select an arbitrary number of date values. It always returned the max date for the date values selected.</p><p>DVF is limiting: single value and only available for discrete date fields.</p><p>Enter sets.</p><h3>Set Control</h3><h4>General Tab w/ Set Actions and Set Control</h4><p>Think of a Set Control as a Filter Control only better. I have <a href="https://medium.com/@flymperopoulos/tableau-sets-and-lods-63ac1f95e66">written</a> and <a href="https://www.youtube.com/watch?v=_UjxpYXl-Fs">talked</a> about the differences between filters and sets before, and the complex things you can do with them, but for purposes of this walkthrough I’ll keep the example very simple.</p><p>We will use a set to color a simple scatter plot and customize its default state. Currently the set contains the Top 2 States by Sales in the Sample US Superstore dataset (Texas and New York). For now, I have removed all California rows from the data. We will bring them back in at the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoEw9k4jis1kawEqG9_O4w.png" /></figure><p>As described above, if I uncheck values in the control, Tableau always applies the top 2 condition on the remaining selected values. As shown below, nothing changes in the view because Texas and New York are still the States with the most Sales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WimVMyGilPbjNOiTfoBdWw.gif" /></figure><p>I can do the same thing with Set Actions and the control behaves like you’d expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJbSBIUaarHAOoPKc5vkXg.gif" /></figure><p>With the Set Control and Set Actions in 2020.2 (Assign, Add, Remove) we are always editing the data values in the General tab of a set’s definition (on which the conditions apply). Everything works as you’d expect.</p><h4>Add/Remove from Tooltip</h4><p>Notice what happens though to the control when I use the legacy Add/Remove option from the tooltip’s command menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKpzgX_9MwnkaC_wQt-uug.gif" /></figure><p>Take a look at the GIF above. What just happened? Tableau removed the condition and shows me the set’s previous values (New York, Texas) plus the new value I added visually (Washington) as selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*Z5_PWj70OLIYtzCKUkc5uw.png" /></figure><p>If we go look at the set’s dialog the condition is gone, as the orange rectangle shows below and the number of States in the set are 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGF9k6muupl0dMBBhTEepQ.png" /></figure><p>But, is the condition really gone? And are the States in the set 3 or 2?</p><h4>Twb Representation</h4><p>Let’s open the .twb file to see the definition for that set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixy6Mz2kZr4GoA8HkqjLBw.png" /></figure><p>Notice that the condition is actually still there. The group of nested groupfilter tags shows this below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qqRuL4CpR4rfA9z2y8vVgw.png" /></figure><p>And not only that, but the new visually added data value is also there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xu_pbtEZ8RXVJhwWz1l7Yg.png" /></figure><p>In other words, this set is now a union of a conditioned set of values (our original set, i.e. Texas and New York) and an arbitrary value (the visually added value, i.e. Washington).</p><p>We don’t have a way to display such a set definition <em>for a single set</em> in Tableau’s UI today, so we remove the condition from the set’s dialog and control, making you think it’s gone. We refer to this set as being “flattened.”</p><p>Now I can remove Washington, the value I just added, and end up with a set whose values are only the ones returned from the Top 2 condition. The set now has the same values we started the example with but its control looks different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LvvxRtBNmPQpVrht7LWy2A.gif" /></figure><p>Here’s how the twb definition looks now. Notice the “except” clause that removes Washington after it was added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQR15poJPNmBAMfuNJcAlg.png" /></figure><p>The magic here is that as my data updates, so will the selected values in my control!! By following these steps, I could specify any arbitrary condition and my set will always default to selecting values that match that condition. Sets can be used as filters, as encoding indicators, in calculations, and more. <strong>With this trickery, the set control becomes a</strong> <strong>default multi-value multi-purpose control.</strong></p><h4>Add California rows back to the data set</h4><p>Now that we saw how it works under the covers, let’s see what happens when I add California back to the data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_aEgjddxafPP4mWu2_WYag.gif" /></figure><p>Notice that California and New York are now encoded as blue in the viz AND selected in the set control after the data source is updated! The Set Control will show the top 2 States by SUM(Sales) selected in the control and your viz consumers can change that to whatever other selection they want when they interact with your viz.</p><h4>Gotchas</h4><p>There are, of course, gotchas with this approach.</p><p>The set definition in the twb will be intact and the set’s behavior consistent if the workbook is saved and published as we left it, shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQR15poJPNmBAMfuNJcAlg.png" /></figure><p>This advanced “hack” trick is, however, quite fragile. If an author edits the set from the set’s dialog, the set control, or a Set Action to add a new State, i.e. “New Mexico,” notice what happens to the twb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j12cutIb_HUzvQohqr7d-w.png" /></figure><p>The condition is gone. Tableau doesn’t know how to edit this new type of “unioned” set we created. As such it assigns the latest selected values to the set’s General Tab definition when the workbook is saved and ignores previously defined conditions.</p><p>This editing is not an issue on the consumption/interaction side, since the set edit does not persist to the twb for future consumptions of the workbook.</p><p>I realize this is a lot of information so please let me know if you have any questions! More posts to come soon :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3af4638e3874" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set Actions: Add/Remove]]></title>
            <link>https://medium.com/@flymperopoulos/set-actions-add-remove-dd3c1768789?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd3c1768789</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 21:43:33 GMT</pubDate>
            <atom:updated>2020-04-21T21:43:33.573Z</atom:updated>
            <content:encoded><![CDATA[<p>In the 2020.2 Tableau beta we released new improvements for the Set Action feature. You can now incrementally add to and remove values from the set even after your selection is cleared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wyZbWfbtwP3bKepl509sgA.gif" /><figcaption>Credits to Sean Boon for helping create this dashboard</figcaption></figure><p>Coupled with the new Set Control, available for the first time also in 2020.2, viz consumers can leverage the power of sets in Tableau like never before.</p><h4>Why should I care?</h4><p>Before Tableau 2020.2, it has been daunting to incrementally adjust what values are in a set visually. Ken’s comment to one of our discussions on Twitter says it best.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*FDeecjUP0k2XY3ChfeM2tA.png" /></figure><p>Just like you can add and remove values to a filter by checking and unchecking values in the quick filter control, you can now do so visually with Set Actions right as you interact with marks in your visualizations. It goes without saying that we are not taking away existing functionality, i.e. the ability to assign your <em>current</em> selection’s values to the set.</p><h4><strong>How does it work?</strong></h4><p>The new Set Action dialog now contains a new section for authors to specify how set members are added to the target set.</p><ul><li><strong>Assign values to set: </strong>Selected marks replace the set members (legacy)</li><li><strong>Add values to set:</strong> Selected marks are added to the existing set members</li><li><strong>Remove values from set: </strong>Selected marks are removed from the existing set members</li></ul><p>You can choose to run the action on Select, Hover, or Menu. Menu gives you control over both Add and Remove functionality from the same visualization. In all action definitions I will show below I have kept the “Clear the selection will” setting to “Keep set values.”</p><h4>Airbnb Neighborhood Comparison</h4><p>In the dashboard that follows we have defined two sets (Set A and Set B) to compare Airbnb listings in the city of Seattle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsfsJYwIL3_zQAjs9-YSIQ.png" /></figure><p>We will create four Set Actions in order to allow viz consumers to</p><ol><li>add values to Set A</li><li>remove values from Set A</li><li>add values to Set B</li><li>remove values from Set B</li></ol><p>For instance, the action that adds values to Set A is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*TaskDUYIGoMOBCeacmiqWA.png" /></figure><p>After we setup all four actions, we can see them in the tooltip ready to be used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLPPpKkOoq4xLPyqbXQhcA.png" /></figure><p>Selecting “+ Add to Set A” adds the marks to Set A and renders the marks yellow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgTa9wL8I685TzjCF65hTw.png" /></figure><p>Easily enough you can go and select more marks in Seattle’s Capitol Hill neighborhood and add them to Set A. By doing so we see in the box plot to the right, certain highly priced outliers (≥$700) now part of Set A .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c89F9lV54ppQwOKVXGQO0w.png" /></figure><p>The marks are colored according to the Set Membership calculation, shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*QMeGXvBy0OVvMpp9YpKuqA.png" /></figure><p>This functionality is available in the 2020.2 Tableau beta and soon in the official Tableau 2020.2 release! Looking forward to hearing your feedback and if anything comes up that you did not expect, please feel free to let me know.</p><h3>FAQ</h3><h4>How does Add/Remove work with Dynamic Conditioned/Top Sets?</h4><p><strong>tl;dr </strong>We always change the selected values in the set dialog’s General tab.</p><p>We refer to dynamic sets as the sets created from a field’s context menu in the data pane. Such sets can be created using the General, Condition, or Top tab. The selections and conditions specified in each of these tabs are AND’d and applied in the same tab order.</p><p>The definition of an arbitrary set of Airbnb listings looks as follows in the workbook’s .twb file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWiwRZLyLZCJyKAgeUqlgQ.png" /></figure><p>In the <strong>group </strong>tag we see the set’s caption, name (immutable), and type (filter-group denotes a dynamic set, lasso-group denotes a fixed set created from the viz). Within the <strong>groupfilter </strong>tag that encompasses the individual data values, we see that these values will be unioned, not-exclusively and come from the field (level) “id.”</p><p>The same set conditioned now by some clause from the Condition/Top tabs looks as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BGrBm_pS6D6nawSFE_l6w.png" /></figure><p>Notice the new <strong>groupfilter </strong>tag encompassing the previous definition. It is filtering the values based on an expression. The set will eventually contain only the listings (id’s) with price ≥$60/night <em>from the selected list of id’s</em>. In other words, the Condition tab filter applies to the selected values in the General Tab.</p><p>With Set Actions and the Set Control we always edit the selected values in the set dialog’s General tab. The same holds true for quick filters, of course, this is no new behavior. There is, however, one exception to this rule that I will outline in a future blog post!</p><p>See you soon :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd3c1768789" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Competitive Analysis with Buffer Calculations]]></title>
            <link>https://medium.com/@flymperopoulos/competitive-analysis-with-buffer-calculations-16f19473d0d4?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f19473d0d4</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Thu, 27 Feb 2020 21:27:49 GMT</pubDate>
            <atom:updated>2020-02-27T21:27:49.810Z</atom:updated>
            <content:encoded><![CDATA[<p>During TC19, I <a href="https://youtu.be/WWECV_a_aaA?t=3600">demo’d on stage</a> Dynamic Parameters and Buffer calculations. These two awesome features are now both available in <a href="https://www.tableau.com/support/releases/desktop/2020.1">Tableau 2020.1</a>.</p><p>I wrote a <a href="https://www.tableau.com/about/blog/2020/2/say-hello-dynamic-parameters">short blog post</a> about Dynamic Parameters earlier this year, so today is all about Buffers. This post walks through the workbook I showed on stage. Hopefully it presents some neat ways to use buffers in your analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpug89VeNwQrGBwUVY3Gug.png" /></figure><h4>So, what is a buffer?</h4><p>A buffer describes a boundary. In previous releases of Tableau, there has been no easy way to</p><ul><li>persist an area of interest as a mark on the viz, or</li><li>analyze point locations from separate tables of data.</li></ul><p>Buffer is a new spatial function that helps us address these analytical gaps.</p><p>To define a buffer all you have to tell Tableau is (1) what points you want to draw the buffer on, (2) the distance you care about, and (3) the units you will measure the distance by.</p><h4>Hotels and Airbnb Competition</h4><p>I have access to a list of candidate locations for a new hotel in Manhattan. I want to define areas around each location so that I can inspect the competition.</p><p>In order to do so, I first need to create points for each location using the lat/long coordinates in our table with the MAKEPOINT function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*att2UeKZkol_LYoKtpDSdQ.png" /></figure><p>Now, in a separate Tableau calculation I’ll define a buffer per location:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*d4wMSM08tuIzh3Jhi8egKQ.png" /></figure><p>When this calculation is placed on detail, it renders a circle around each Hotel. Placing Address (i.e. the dimension identifying the Hotel location) also on detail allows me to interact with distinct buffer marks per address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDp6KN2ZVZRr7i1nGncjfg.gif" /></figure><p>Substituting the 200m value with the “Buffer Radius” parameter allows everyone to change the size of the buffers in the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94goLTDo1TdMmS5NqrQtiw.gif" /></figure><h4>Cool, but now what?</h4><p>We learned how to define and render buffers in a Tableau map. But buffers are more than just visual overlays; they help us bring location data together.</p><p>To find out what is the best location to open a new hotel, I’ll bring in another table containing Airbnb locations in West Village.</p><p>In the data source pane, I will create a spatial join that will only return Airbnbs within a 200 meter radius from each hotel buffer. With buffers I can now easily return rows for which location-driven polygons intersect with points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FoYzo12Aaqa0T9mWvS5QMw.png" /></figure><p>With the joined data I can now easily ask questions about the proximity between hotels and airbnbs.</p><p>Let’s start by estimating the distance between the two.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*Uj6SE_5sjjQDyM4NEvUHDw.png" /></figure><p>Now that we have this, we can store in a calc all Airbnbs that are within the buffer radius distance per Hotel, as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*lSE0e8Fy_dQz4ErCzCOCvQ.png" /></figure><p>Placing the above calculation on the detail shelf of a separate pane gets us a all Airbnbs in the buffer area of our hotels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOTCd5f-fiIuCToumH1tag.png" /></figure><p>Now as I change the parameter, the radius updates, which causes the calculation to return an updated set of Airbnb marks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aa8dG8q6jdpJp_gIINRdPQ.gif" /></figure><p>Now that the map updates to show me the correct information visually I want Tableau to count for me all the marks within the updated boundaries.</p><p>We are one calculation away from making that happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*UimwDPLfYvsWFYHoS0yj5A.png" /></figure><p>Similarly to the filtered Airbnbs shown, the above calculation checks the distance between Hotel and Airbnb locations, compares it to the radius and if its less than the radius adds 1 for every row at the hotel level of detail.</p><p>Place the calculation on the Label shelf of the pane defining the buffer and you are done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEZjOOi2C1dvwHVKg2ft1Q.gif" /></figure><p>It goes without saying that buffers play well with other interactive analytics features, such as Set and Parameter Actions. More blog posts on this coming soon!!</p><p>Until then, enjoy 2020.1 and please let us know if you have any feedback to make the product better! ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f19473d0d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Muting Selection in Tableau]]></title>
            <link>https://medium.com/@flymperopoulos/muting-selection-in-tableau-82baf175c614?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/82baf175c614</guid>
            <category><![CDATA[tableau]]></category>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 22:06:04 GMT</pubDate>
            <atom:updated>2019-11-21T22:06:04.095Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes selection feedback in Tableau gets in the way. While it is useful to apply a border to the selected marks and fade out all other marks in a visualization, you should have the flexibility to choose when that happens.</p><p>In the <a href="https://youtu.be/WWECV_a_aaA?t=3839">familiar viz</a> below, I am selecting marks on the map and Tableau returns the average price for the selected zip code(s) and the respective YoY change. Everything works but my map looks off… As I select zip codes I want to see the YoY changes for other zip codes right on the map but Tableau fades the marks out and its hard to discern the labels. This is true for all mark types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_znjlsoo84fRt0QjuxYJw.gif" /></figure><p>With just two steps, I can “mute” the selection feedback and have my map stay visible as I select new marks. While we do not support such functionality out of the box yet, there is an easy way to work around it.</p><h4>1. Foo to the rescue</h4><p>In the Map sheet, create a constant calculation “foo” and place it on Detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQuuQBbFvQJoQYF5leD7Tw.png" /></figure><h4>2. Highlight Foo</h4><p>Back in the dashboard create a Highlight Action and target the Foo field in any viz you are using Foo. In our example this is just the Map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PEbMnB7kjamlbztNiiYyA.png" /></figure><p>Done. Now select marks and Tableau will <em>not</em> fade out the marks not selected. It is highlighting all marks, since all marks share the value “foo,” and makes the selected one stand out a little bit more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTZD6UR5_q-MwNjdWV3AZg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82baf175c614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scented Controls in Tableau]]></title>
            <link>https://medium.com/@flymperopoulos/scented-controls-in-tableau-be72b487fb8a?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/be72b487fb8a</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Tue, 19 Nov 2019 16:18:49 GMT</pubDate>
            <atom:updated>2019-11-19T16:18:49.766Z</atom:updated>
            <content:encoded><![CDATA[<p>TC19 was sooo much fun last week!! Seeing old friends and making new ones makes this event my favorite of the year. I cannot wait for next year!!</p><p>During IronViz we all saw Lindsey Poulter build the awesome <a href="https://www.lindseypoulter.com/2019/11/16/custom-dropdown-with-parameter-actions-show-hide-container/">custom control</a> using collapsible containers and parameter actions. Watching her set this up reminded me of a hack I built earlier this year and never shared with the community.</p><p>Showing more context alongside control values is informative and gives authors options to (imperfectly) sort the values in the control.</p><p>In the gif below every Customer Name is prepended by the total dollar value in Sales the customer has contributed and… a bar. How do we get those bars in the quick filter control?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWQYGjdX1_Ab6qyOOBzDjw.gif" /></figure><h4>Start simple</h4><p>Evaluating the total sales per customer is a simple level of detail expression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*eTHnCwBrdaJ1NpQKsplDww.png" /></figure><p>Because we will be using the returned values in a separate calculation and we want to maintain a specific format, we need to floor and cast the measure values using the following calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*6ue4W50qfoe6XcC4iasi_w.png" /></figure><p>Concatenating the resulting expression gives us a field that contains the revenue per customer and customer name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*SN18Pzvrjcf8iXVdnSmXcA.png" /></figure><p>Describing this calculation from the schema viewer shows us this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*zL748Mr_yZVF3XBH2DCnUA.png" /></figure><p>We got the sales values in thousands for each customer, but:</p><ol><li>we don’t have the visual indication for those sales (the bars) and</li><li>our customers are sorted alphabetically, not based on a measure (sales).</li></ol><h4>Binning</h4><p>In order to create these bars we need to bin our customers in groups based on their spending with respect to customer that contributed the most.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*s04A_eAMgSjW733GFLtnLw.png" /></figure><p>This calc returns values from 0 to 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*D2o0bpbGb_9J5hNVIci4tA.png" /></figure><p>We can now create N bins and allocate customers to each bin. Let us, for instance, say we want 10 bins. To do that we can create a “whole” parameter that contains 10 “|” values, i.e. “||||||||||”. With the following calculation we incrementally return parts of the string parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*g6WsBZY4AZqVQlyll65zYA.png" /></figure><p>Customers that fall in bin #1 will be allocated a value of “|” while customers that fall in bin #2 will be assigned “||”. The customer that contributed the most overall gets assigned to bin #10, i.e. “|||||||||”.</p><p>The final step is prepending the Resolver calculation to the “Customers with bars.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hQtGwdTbF1hfxqn2MDT6A.png" /></figure><p>We can now “Show Filter” for this calculation and with the default sort set to “Ascending” we get the card to the left. Clearly, customers with the least sales are in the first bin. If, however, we change the sort to “Descending” we get back a control showing the customers with the most sales at the top, shown to the right. Getting closer…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*_9LaT-Hy9VR23IkT3jUxBw.png" /></figure><h4>Unicode Block Binning</h4><p>Now that we know how we can bin and (kinda) sort, let’s leverage <a href="https://en.wikipedia.org/wiki/Block_Elements">unicode magic</a> and dump values into 8 bins. This time, instead of multiplying the “Proportion of Sales” calculation by 10 we will multiple by 8 and take the ceiling of the result. Then, instead of parsing the string parameter and returning N “|” symbols, we will return a different unicode box symbol, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*_a65gBe65U60FE2uKDI_fA.png" /></figure><p>The great thing about this is that we do not need to invert Tableau’s default sort order for the calculation “Customers with bars.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44B10ZWFmJoGHIE9xShKFA.png" /></figure><h4>Caveats</h4><p>Sorting values in a control based on unicode strings is a nice workaround for bin sorting but not for actual measure values, i.e. John Lee should be below Bill Shonely etc. It goes without saying that the measure value chosen to bin the Customer Names could be something different than Sales but for the sake of simplicity we stayed consistent.</p><p>Keep in mind that the queries we generate for this will not be ideal as we are generating a filter using the formatted values.</p><p>Nonetheless, this workaround helps you add more context to all your controls (Parameters, Quick Filter, Data Highlighters, Legends and soooon Sets!) and hopefully shows how a withered technology may shine in Tableau. ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be72b487fb8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parameter Actions: Concatenation]]></title>
            <link>https://medium.com/@flymperopoulos/parameter-actions-concatenation-e0c9ec82a34e?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0c9ec82a34e</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Mon, 08 Jul 2019 22:25:50 GMT</pubDate>
            <atom:updated>2019-07-10T15:47:08.882Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Join </em><a href="https://www.tableau.com/products/coming-soon"><em>Tableau’s 19.3 pre-release</em></a><em> to experience the latest Parameter Action enhancements.</em></p><p>In 19.2 we shipped Parameter Actions and we have been inspired by the community’s creativity and feature adoption. In 19.3 we are introducing three new aggregation methods (first quartile, third quartile, and string concatenation), as well as a new “Create New Parameter…” shortcut right in the Actions dialog. These enhancements allow you to answer more questions and improve your analytical authoring flow.</p><p>In this short blog post we will briefly recap the fundamental difference between Set and Parameter Actions and see how the new concatenation aggregation method can bridge the gap between the two. Concatenation refers to the operation of joining strings with a delimiter separator between each string value.</p><p>Let’s go.</p><h4>Recap of Set and Parameter Actions</h4><p>Sets are well-defined in a single data source. With Set Actions you can select what values from the field(s) that defined the set are IN the set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pRfoO3K7jsOxP0mOkto4DQ.png" /></figure><p>Parameters are well-defined workbook constants. With Parameter Actions you can select values from any field of any data source and assign that value to a parameter. As shown below, this can be a single row’s field value (Sales), or the result of an arbitrary calculation. The latter can be as simple as aggregating multiple rows (Profit), appending and prepending values with a character (*), or evaluating the result of a table calc (window_sum(SUM[Sales]), first(), last()) and storing it in a parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UoEPD9hhEni8-HtJM3th_g.png" /></figure><p>Parameters can be flexibly used across datasources, however, they are always a single value. Sets can take multiple values but they are bound to a single datasource. Therefore, asking relationship questions across data sources is challenging, at best. Jonathan Drummey has published a <a href="http://drawingwithnumbers.artisart.org/how-to-have-sets-with-your-secondary-data-sources/">very informative post</a> on sets and blending that approximates that challenge. But what if I told you that in Tableau 19.3, with parameter actions “cross-DS sets” are only a click away?</p><h4>Concatenation: A New Hope</h4><p>In the schematic that follows I select two marks. I have setup a Parameter Action that targets “Param B” and assigns to it the State values visually selected. Because “Param B” is a single-value constant, I need to aggregate the State values selected. Instead of picking the alphabetic min (MA) or max (NJ) value of the selected States, I want to keep both State values in the parameter by concatenating them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHjE7hEBQbZEPpC15Z3kzw.png" /></figure><p>This selected set of State values is now stored in “Param B” and can be referenced in calculations in any data source. Why should you care?</p><p>Let’s look at an example using two simple data sources: one contains a list of clients and their phone numbers, while the other contains my company’s sales broken down by customer, product, region, and date of purchase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*lQws_BwwPZ0ep5mDJhoNDw.png" /></figure><p>I do not want to blend and establish relationships between fields in my datasources, neither do I want to join the two tables. I simply want to define a set of values that I care about and fluidly use that set of values across data sources. I will first put together a source sheet showing all my clients from the phone directory and create a parameter action that stores my selection’s values.</p><p>This is manifested by a new dropdown option in the parameter action dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQ_pzfPDq3h32fsTofBpig.png" /></figure><p>When I connect to the Sales table, I can write a calculation that checks each row to see if that row’s “Customers” value is in “Selected Clients.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*pnniFRSudneMk0R6Mr-ZCg.png" /></figure><p>This calculation returns True or False, effectively resembling a set. We can place it on color and see what selected clients from the Phone table have purchased in the Sales table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*KDzBFiYR1ed1zuFlIRgxXg.gif" /></figure><p>We can create as many “Contains” calculations as data sources we want to query using the input client list. As the diagram below shows, we can use the concatenated list of values (“Selected Clients”) and create Customer sets in different datasources (“sales directory,” “deals closed,” “partnerships”) based on the appropriate customer field in each data source (Customers, Leads, Partners, respectively).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYs9NNSc85Ss5nC_2Kz9qA.png" /></figure><p>I hope this gave you a good sense of the power this new enhancement offers. As always, feel free to reach out with any questions and keep on sharing the great vizes you build with #ParameterActions ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c9ec82a34e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parameter Actions: Layered Analysis]]></title>
            <link>https://medium.com/@flymperopoulos/parameter-actions-layered-analysis-5f274728523e?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f274728523e</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Fri, 31 May 2019 19:05:12 GMT</pubDate>
            <atom:updated>2019-05-31T19:05:12.724Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://twitter.com/datakmart">Kent</a> is jubilant in our Seattle office as his Raptors have progressed to and won Game 1 of the NBA Finals. To celebrate this joy, I decided to stick with the Toronto dataset from my previous <a href="https://medium.com/@flymperopoulos/parameter-actions-year-over-year-comparison-320a9a896553">blog post</a>.</p><p>In this post, we will look at examples of interactive layered analysis. We will build an interactive slope chart that lets us easily reveal the percent change between an arbitrary point in time and the latest month in our data. We will also look at how we can interactively customize a line’s to indicate the window we are inspecting and help end consumers ask the next question.</p><p>This interactive visually layered analysis is powered, of course, by Parameter Actions.</p><h4>Interactive Slope Line</h4><p>With Parameter Actions, Tableau can store a mark’s value when we hover over it and use that value in calculations. This allows us to compute the percent change between the hovered and the last mark, but also draw a line connecting the two points of interest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0g0u6xUy8D-YHay21s3dRw.gif" /></figure><p>Let’s start by looking at the average trend of house prices over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdjL4DN8lqJeGlMuTHvlyQ.png" /></figure><p>We will create a parameter and a Parameter Action that changes the parameter’s value to the hovered mark’s date value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_leGlSSWwsekKpljB9j3g.png" /></figure><p>As the following GIF shows, the parameter now updates to a new value as I hover around the viz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ewFvNrluFHX3TSVmWZxSQ.gif" /></figure><p>On a separate pane, we now want to draw the two marks that will be overlaid on top of average trend line: the one I am hovering over and the right-most (last) mark in the view. For the former, we simply check if the value assigned to the parameter matches a row in our month data. To find the latter we will use the <em>last() </em>expression; with it we check the number of rows from the current row to the last row in the view and return true if there are none left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaMeqq4bWqfQC9o7LP7E5g.png" /></figure><p>This draws the two marks of interest in the view. Dropping the same calc in the Path shelf connects the two non-null valued marks. We can then create a dual axis for the two panes and synchronize the axes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dsk7gQBfDx8tHj5s02kskQ.gif" /></figure><p>After configuring the encoding settings and header visibility we are left with the last step: placing the percent change label on the last mark in the view. To do so, we will first store the hovered and last values separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tEfxtfJmhpygeDKLIoSZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*aA3Og-e0Mcbzh3B32bb40Q.png" /></figure><p>We are using window_max because we want to replicate the value across the table in order to perform the eventual percent change calculation.</p><p>Now we can devise the percent change value between the two and position it in the last row of the partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*8UifF1ZjPy1N3HqsDYx6hw.png" /></figure><p>Placing this final expression on the pane’s Label shelf gives us our final result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0g0u6xUy8D-YHay21s3dRw.gif" /></figure><h4>Interactive Custom Marks</h4><p>An extension of this design looks at the same question but instead of layering a slope line we superimpose marks within the window of the hovered and last value. We also make the line appear “dashed” for marks outside the window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5d01JzqBYZRX_Egb_eejPA.gif" /></figure><p>In order to accomplish this we will track the mouse’s position with the same Parameter Action the previous example used and explicitly create two groups of values: edges and outer values. The mark we hover over and the last value in the partition are the edges, “edge_1” and “edge_2,” respectively. All dates before the hovered mark are considered “outer.” The calculation’s null values are found within the two edges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJk_Rn0fBA2AYfsQQwDbuw.png" /></figure><p>Duplicating the pill on the Rows shelf and placing the “Custom Marks” calculation as the pane’s color indicator gives us the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zv3XBIo0hrjlJhrBb212gw.gif" /></figure><p>Assigning white color to the “outer” group of marks gives us the intended “dashed” effect. Same exact calculation as before is used to place the % change label on the last mark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHUX35mqB1wpZ58CR0Z3kA.gif" /></figure><p>That’s it. Parameter Actions let you easily layer information on your visualizations and interactively gain insights to your data.</p><p>I am sure there are so many more creative examples soon to be revealed from our amazing community.</p><p>Please reach out with any questions or new ideas! ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f274728523e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parameter Actions: Year over Year Comparison]]></title>
            <link>https://medium.com/@flymperopoulos/parameter-actions-year-over-year-comparison-320a9a896553?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/320a9a896553</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Wed, 22 May 2019 20:33:23 GMT</pubDate>
            <atom:updated>2019-05-22T20:33:23.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Tableau <a href="https://www.tableau.com/products/new-features">2019.2</a> is now available. Our team is excited to introduce Parameter Actions as part of this awesome release. This feature allows you to visually change a parameter’s value and, as a result, interactively change inputs to your analysis.</p><p>In my previous <a href="https://www.tableau.com/about/blog/2019/5/parameter-actions-extend-interactivity">blog post</a> I touched on a variety of use cases Parameter Actions can help with your analysis. Part of those use cases involved time.</p><p>In this post I will breakdown how you can build interactive Year over Year (YoY) charts. Contextual labels are added right in the view to let you easily compare percent changes between different time periods.</p><p>To demonstrate the power of Parameter Actions, we will look at a dataset of Toronto home prices. Last week I was in Toronto attending one of Tableau’s Customer Success Summits. It was great to catch up with customers and discuss some of the latest interactive analytics features we are shipping this year as well as our vision for the future of Tableau interactivity. I hope this example drives home the new powers this feature gives you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvfYClIm2sLIGDv3jY1mPg.gif" /></figure><p>We will get started by creating a viz of different Toronto property types over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOM2renUgtzRSG_saN6wiw.png" /></figure><p>Then we will create two parameters, “Current Left Date” and “Current Right Date” that will define the left and right boundaries of this year’s analysis window. Each parameter should be defined, as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wq7PhfWFAfSPTBK9g7cArw.png" /></figure><p>With the newly defined parameters we can now place the band in the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WWboVxFiVgnLXQh4U26zhQ.png" /></figure><p>Now that we have the current window rendered we need to calculate and show the same period last year. To do so, we will author two calculated fields that each subtract a year from this year’s left and right boundaries. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*shyU68rPHDdaKGt6WiCMeQ.png" /></figure><p>Dropping the two new calculated fields in the Marks card Detail shelf as Continuous Exact Dates allows us to render the left reference band.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCEsB7-UOICHuS5ixlkemQ.png" /></figure><p>However, nothing happens yet when we select marks on the visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SiDRfITTCrLfcrI-NyZwzA.gif" /></figure><p><strong>Parameter Actions to the rescue!</strong></p><p>We will leverage Parameter Actions to interactively change the two “Current” parameters. One action will pick up my selection’s minimum month value and assign it to the “Current Date Left,” while the other will store my selection’s maximum month value to the “Current Date Right” parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-Lp0bfXOh7ruthMG_jaAA.png" /></figure><p>Now as I select marks in the viz, Tableau updates the position of <em>both </em>reference bands. Mark selection causes the parameters to update, which in turn cause the calculations to update, and the reference bands to re-render.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-i7OXOXjjhFAnDBJjewQFg.gif" /></figure><p>We still have to calculate the percent differences for each window and display the metrics in the view. To do so, we will store the average sold price for each band endpoint in a calculation. For example the current left value is defined as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUVerSkLy6XmHDMj4XQaUQ.png" /></figure><p>Same exact syntax applies for the previous year’s window. Then calculating the window’s % difference relative to the previous period is as simple as this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3o_CsEbaMFdGHkAOvmPi1g.png" /></figure><p>Same exact process applies for the previous year’s window. Now, in order to interactively show the % difference labels in the center of each band, we need to find each windows date midpoint. For the right window, we will write the following expression:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5Nwi3IFJmjSeQM3NTauUg.png" /></figure><p>This calculation finds the difference, in months, between the band’s endpoints, divides that number by 2, takes the floor of that, and adds this many months to the band’s left endpoint.</p><blockquote>Note that the midpoint date value will not always be in the middle. Since Tableau needs a row in the data to draw the mark, in the case where the number of month marks between the endpoints is even, such mark doesn’t exist, and we floor the result and draw it offset to the left.</blockquote><p>We will then create a calculation that will only return values for which the middle date in each window matches a date in the data table. This will effectively be the y position the label is drawn on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BRd55OnipBYb0lwpcJzzVQ.png" /></figure><p>Now we have to finally place the right value as Label for the “Label Y Position” mark. For this we will author a different calc, “Value Placer”, that returns the already calculated % difference calculations for each window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xB609xHR9c8QYPmA_LVPzg.png" /></figure><p>We can now place the “Label Y Position” on Rows and Dual Axis the two panes so the labels and trends are superimposed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svf4PmcPhYMTP1EkB3S3GQ.gif" /></figure><p>I hope this walkthrough helps you see how you can leverage Parameter Actions to interactively answer a very common business question. This new feature allows you and your consumers to quickly inspect trends in a viz and get to insights faster!</p><p>Go play with Parameter Actions and let us know what you think!</p><p>There’s more magic coming soon ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=320a9a896553" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Date Selections]]></title>
            <link>https://medium.com/@flymperopoulos/date-selections-f8d9aa787e7c?source=rss-a3d2aefadd88------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8d9aa787e7c</guid>
            <dc:creator><![CDATA[Filippos Lymperopoulos]]></dc:creator>
            <pubDate>Sat, 30 Mar 2019 01:05:29 GMT</pubDate>
            <atom:updated>2019-03-30T01:57:31.098Z</atom:updated>
            <content:encoded><![CDATA[<p>Selecting date values for analysis is fundamentally different from categorical selections. With dates you rarely want to “select” just one value. Take these two questions for example:</p><blockquote>How many Sales did we make on June 2016?</blockquote><blockquote>What are the YtD Sales for that month?</blockquote><p>The reference date is the same in both cases. In the former, we select a single value (June 2016), but in the latter we want to pick six distinct MY values (Jan-June 2016).</p><h4>First Attempt</h4><p>We can take a stab at these questions using quick filters. Here’s one approach:</p><p>In one sheet, place SUM([Sales]) on Label, drop Order Date (Discrete MY) on the Filter Shelf and select June 2016.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoO8vGgiuR68QGkoZuCOKQ.png" /></figure><p>In a separate sheet, use the MY date field on Columns and SUM([Sales]) with a Running Total table calc on Rows. Drop the Order Date field on the filter and manually select all 2016 months before and including June.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GScoWth6IvuAuroAOCuOyQ.png" /></figure><h4>Synchronization</h4><p>Looks like our first attempt is working. Let’s bring both sheets in a dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70g6bi5rfFENbG7Syow43A.png" /></figure><p>If we change the first sheet’s filter from June 2016 to November 2016, Tableau correctly updates the top sheet’s information, however, it is impossible to have the two filter controls stay in-sync. As a result, the YtD viz will still show YtD information based on June 2016. Even if we set the first filter to default to the latest date value (i.e. December 2018) this leaves the YtD filter unaffected.</p><p>Viz consumers will have to change both date controls every time they want to ask a new question.</p><h4>Second Attempt</h4><p>Quick filters clearly don’t work so let’s try out our luck with parameters.</p><p>In order to construct the first viz we’ll instead create a date parameter and write the following calc. With this boolean output we keep rows that have a matching month and year value as the parameter’s value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*a1VPeHE8S_oBt6mbZ4RUMA.png" /></figure><p>Replace the quick filter with this calc and show the parameter. Since we want to control both vizes with a single control and have that control select different values per sheet, we can write a YtD calc and replace the quick filter in the second sheet. It’s close to an identical calc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*m0-IJSfmlChNNq1s2KYR_A.png" /></figure><p>A single date selection results in separate filter definitions across sheets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCFcDT46fNX3BxS97Ysvkg.png" /></figure><h4>Pill-level filtering</h4><p>With our second attempt we accomplished synchronization. Since we can consume parameters in calculations, we can use them to filter a column/pill instead of entire sheets. For instance, we can store YtD Sales values for re-use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*r4iTTWE5dBo0lfmryRkjUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*fjXziWZRmb0n5u6l7Mw3oQ.png" /></figure><p>This way we can compare YtD metrics between the selected month’s year and the prior year’s same period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4uysHcxG8b2ijb5N8PId4g.png" /></figure><p>With this approach, our dashboard contains vizes with elaborate metrics and date intervals calculations resulting from a single date selection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlBqgI_byJYADnj_N6U9mg.gif" /></figure><p>Date selection is rarely singular and you usually deal with more than one date domain. The complexity of those calculations can grow and parameters give you one easy way to control all these operations.</p><h4>You</h4><p>If you have examples to share, enhancements you would like to see, or ideas pertaining to Tableau temporal analysis, feel free to reach out! I’d love to chat with you :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d9aa787e7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>