3 Replies Latest reply on Apr 11, 2018 3:26 PM by Okechukwu Ossai

    Display the value from Column A based on B

    Paul Gonzalez

      I would like to very simply display the current leader based on column B values on a dashboard.

       

      names.png

      How would you do it?

        • 1. Re: Display the value from Column A based on B
          Okechukwu Ossai

          Try this calculated field

           

          [Current Leader]

          IF {FIXED: MAX([Score])} = [Score] THEN [Name] END

           

          Alternatively, use this Boolean calculated field as a filter and set it to True

          {FIXED: MAX([Score])} = [Score]

           

          Hope this helps

          Ossai

          • 2. Re: Display the value from Column A based on B
            Paul Gonzalez

            Very nice, thank you very much.

             

            Can you give me a little insight as to why this formula automatically became a dimension?  It was a measure when I calculated the max score with a simple MAX(Score).

            • 3. Re: Display the value from Column A based on B
              Okechukwu Ossai

              You're welcome Paul.

               

              MAX(Score) will return the maximum score (69) for column B, which is a number hence a measure.

               

              However, the [Current Leader] calculation is an if statement which first calculates the MAX(SCORE), in this case 69, and then pans through the dataset row by row checking if MAX(Score) is equal to Score for that particular row. If the condition or 'check' is true, it will return [Name]. Barney met that condition and the name is returned. Since Barney is a string, hence the calculated field is a dimension.

              Summary: MAX(Score) returns a number (69) which is a measure while [Current Leader] returns a name (Barney) which is  a string hence a dimension.

               

              The alternative calculation is a Boolean which returns True or False if the specified condition is met. True/False are strings, so the calculated field is also a dimension.

               

              Hope this helps.

              Ossai

              1 of 1 people found this helpful