❓Did you know that you can sort by nested *Measures* within Tableau? 📅 I've been using it for 7 years, and my first need for it came up this week. ⭐ Sometimes I think I know the product pretty well. ⤵️ Then I’m hit with a functionality curve ball that really surprises me. 😀 In this case, I am happy that it works the way it does. ⚖️Paradoxically, it is both intuitive and non-intuitive at the same time. ☑️ It's intuitive for the novice, who expects an alpha sort to work like a numeric sort. ✅ It's non-intuitive to the more seasoned analyst, who would expect to need to left-zero-pad the numbers for the order to be preserved. 🔎 I searched for a solution and found something like the following on Tableau's site. I thought, "That will NEVER work, and I'm going to show them!" STR(RANK([Sub-Category Count])) + '-' + STR(RANK([Profit Ratio])) 🤯 It worked. ✏️ BTW, I always use single quotes in my Tableau calculated fields in case I ever have to convert them to SQL; it's one less thing to fix. 🤔 I was expecting it to alpha-sort like every other system I ever saw: 1-34 10-53 11-98 2-77 And within any repeating first number: 4-10 4-117 4-23 😲 But, no! Tableau alpha sort of dimensions detects and respects numeric values! It would work like this: 1-34 2-77 10-53 11-98 and 4-10 4-23 4-117 ❌ So I didn't have to create: 01-034 02-077 10-053 11-098 and 04-010 04-023 04-117 🔨 Anyhow, I made a dashboard to simulate my actual use case within SuperStore. ⚠️ I DID have one case where I had to zero-pad to the same length if the numbers were all decimals less than 1. 🏗→🧠 Build to Learn! 💭🚶♀️🚶♂️ Follow for more. #tableau #data #analytics #VizoftheRay
Perfect timing. Was looking for something like this just yesterday afternoon!
📈 Data → Decisions✔ | Balancing Design and Pragmatism in Tableau | 2024 Tableau Social Ambassador
5moTableau support article: https://kb.tableau.com/articles/issue/nested-sorting-by-two-measures Dashboard: https://public.tableau.com/app/profile/ray3296/viz/SortbyNestedMeasures/NestedMeasureSort