5 Replies Latest reply on Jun 11, 2018 6:14 PM by Peter Fakan

    Top N Set question

    mike.czyzewski

      Hi!

       

      Please see attached.  I am trying to create a view which shows the Top N gift donations asked.  I have a number of filters in there as well so end user can pick the name of the person asking, the month and year.  Set IN/OUT check box is also in view.

       

      My set is supposed to return the top 5, but Tableau doesn't seem to return what I think it should.

       

      One question I have is regarding context filters.  I have set my month, year and name filter to be context filters because, if I understand Tableau's order of operations correctly, I want tableau to execute the name, month and name filter and THEN apply the Set filter.  I could be wrong about this.

       

      Could you please look this over and let me know where I've gone wrong?

       

      Thanks!

        • 1. Re: Top N Set question
          Peter Fakan

          Hi Mike,

           

          Do you mean like this ?

           

           

          Step 1 - I created a rank_unique field to give a rank on the average(amount asked). This is converted to a discrete so that it can be used as a blue pill.

           

          Step 2 - drag the rank field onto the viz

           

          Step 3 - also put rank on filter, and select the top 5

           

          HTH 18.1 attached

           

          Peter

          • 2. Re: Top N Set question
            mike.czyzewski

            Hi Peter!

             

            Quick examination, but it seems to do what I need.

             

            Tableau noobie question here, but the Rank calculated field is recalculated each time I change the view.  For example, if I change form 2018 to 2017, it recalculates for 2017, right?  Put another way, the context filters I put in the viz return a subset of all underlying data and then Rank is performed on the subset, right?

             

            Also, is there a reason why I couldnt' have used a set to accomplish the original goal?

             

            Thanks again!

            • 3. Re: Top N Set question
              Peter Fakan

              Hi Mike,

               

              Yes thats correct, and we can work on a fixed rank if you want it that way.

               

              We could have probably stumbled around using sets but we need to be creating the sets by using a calculated field, not just manually dumping items in/out of set and I didn't want to go through the hassle of working it out that way Seemed easier to just go straight to the best practice option.

               

              HTH

               

              Peter

              • 4. Re: Top N Set question
                mike.czyzewski

                Hi Peter,

                 

                Yes, rank does seem like the path of least resistance.  However, I had learned about sets in a Tableau course I've been working through and it seemed like a good way to try and apply that knowledge.  Maybe next time.

                 

                Thanks again for all the help!

                • 5. Re: Top N Set question
                  Peter Fakan

                  Hi Mike,

                   

                  No worries, good luck with the rest of the course I tend not to recommend using sets as they get used as cheap alternatives to calculated fields, which then turn into future headaches when you have to unpack them into a calculated field and reapply the logic through the rest of the viz because they don't work in the same way as calculated fields.

                   

                  HTH

                   

                  Peter