3 Replies Latest reply on Oct 5, 2016 11:13 AM by Adam Erdesky

    How to get the dimension value associated with the max, e.g., of a measure?

    Adam Erdesky

      Say I've got the following result in a worksheet (from the Superstore dataset):

       

      SegmentSUM(Sales)
      Consumer1,161,401
      Corporate706,146
      Home Office429,653

       

      ...but that I want to add another worksheet to contain a short piece of prose to enhance the dashboard and aid understanding by the end user. On this second worksheet, I want to use a calc field to create the sentence, "The Consumer segment is associated with the largest sales volume ($1,161,401)."

       

      How can I get the dimension value "Consumer" using functions?

       

      "The " + <associated dimension value> + " segment is associated with the largest sales volume ($" + str(round(WINDOW_MAX(sum([Sales])),0)) + ")"

       

      Or--is there a better approach altogether?

       

      Thanks!