4 Replies Latest reply on Aug 8, 2018 3:34 PM by Joseph Wibowo

    Show Reference Line Based on Parameter

    Joseph Wibowo

      This is incredibly frustrating and I know there is an easy way to do this. I have a parameter of sales reps and I want to show their goal as a reference line on a graph based on which rep is selected. The x axis is the date and the y axis is sales. I can't figure out how to show the goal filtered by the sales rep. Any help is appreciated. I have spent way too long on this.

        • 1. Re: Show Reference Line Based on Parameter
          Amanda Paige Michaels

          Hi Joseph,


          Drag your Measure with the goal data into the Detail box in the marks pane. Under Analytics, (located next to data in the far left pane), you can drag the reference line onto your sheet. If you goal is daily, set it per cell, if it's per total, then set it for the Entire table.


          In the edit reference line box, set the value to goal and sum.


          Hope that works!

          • 2. Re: Show Reference Line Based on Parameter
            Peter Fakan

            Hi Joseph,


            Click on the Analytics tab, then drag Reference Line over your entire table - you should be able to select a parameter from the drop down value box.



            In your situation, it looks like you need to provide a value for each sales rep, but each sales rep is already a parameter. You can unpack that into a calculated field;


            case [parameter]

            when "sales rep1" then 100

            when "sales rep2" then 150



            and then drop this into the marks area of your viz - this will then appear inside the same value drop down box. Upload a .twbx if you are having any more problems and I'll work through it with you.





            • 3. Re: Show Reference Line Based on Parameter
              Joseph Wibowo

              Hi Peter,


              I have tried something similar. The problem is that the reference line value is vastly larger than what it should be. I'm not sure how the reference line is calculated, but it doesn't seem that it simply takes just the constant value from the calculated field. I can't give a workbook because the data is connected to my data warehouse and I don't want to publish proprietary info.

              • 4. Re: Show Reference Line Based on Parameter
                Joseph Wibowo

                Well, I just realized that the right solution is just to use MAX() on a constant and not even use a reference line. Thanks for the help.