5 Replies Latest reply on Apr 9, 2018 11:13 AM by Jim Dehner

    Show Top N by Year

    Roger Stephens

      I have been trying for days to display the Top N Data filtered by year.  I have followed several other discussions and tried the suggestions noted in those, but I am still having trouble getting this to display properly. I am guessing I have something in the order of operation out of order, but i can't figure out where I am going wrong. The two worksheets in the attached workbook show two of my approaches at doing this.  You will notice that it almost gets there, but if you add years to the filter items that should be considered in the set will show as out of the set.  Where am I going wrong?

        • 1. Re: Show Top N by Year
          Jim Dehner

          Hi Roger

           

          I took your LOD and created a rank based on it

           

          then created a parameter juts for top N (didn't want to mess up yours)

           

           

          then a filter based on the combination

           

          I just created a text chart - could be anythiing'

           

           

          Jim

           

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          • 2. Re: Show Top N by Year
            Roger Stephens

            Jim thanks for the suggestion, but it doesn't seem to be getting me where I need to be.  I am trying to visualize the Top N only for each year and be able to adjust for N as well as year. Unless I'm missing something, your suggestion seems to aggregate all of the causes that occurred in the  X-Year period and display them all for each year but shows a rank value.  SO for the example data given: Doing a Top 2 by year (2016 and 2017)   -  2016 would show (in descending order) Act of Nature  45, Inattention 37 and Positioning Body for task  30, then 2017 would show Inattention 45, None Applicable 30, and Act of nature 28. I am striving for a visualization similar to what is seen on my example worksheet "Using Rank on LOD expression".  I would eventually not display those items in the OUT set, but as you can see the set is triggering wrong on looking at the 2018 charting.

            Maybe I'm missing a step?  Do I need to create a set using your LOD filter or Rank of LOD ?

            • 3. Re: Show Top N by Year
              Jim Dehner

              see the attached

              it returns this using the date filter as set up

               

               

              the filters and rank are set like this which creates a to[p N rank by year

               

               

              Jim

               

              If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

              • 4. Re: Show Top N by Year
                Roger Stephens

                Thanks Jim, I guess I had been looking t and thinking about this for too long and my thought process bogged down.  Your suggestion is just what I am looking for and it seems to be working perfectly. 

                • 5. Re: Show Top N by Year
                  Jim Dehner

                  Thanks

                  remember in tableau there is often more than one way to solve a problem

                  Glad to help out

                  Jim