Forum Discussion

cmiller's avatar
cmiller
Data Storage
01-20-2025
Solved

How to add a benchmark/trend line based on dynamic conditions to a chart?

Hello, 

I'd like to add trend lines to a line chart (like this) but based on the data existing in the chart.

For example the benchmark line would be 5% higher than CVR1 and the Target line would be 6.5% higher than CVR1, this would be moving week on week.

Thank you in advance for your help! 

  • Hey cmiller ,

    I dont know if the following is what you are looking for, but it can perhaps point you in the right direction. I do not know a lot of javascript so I tend not to meddle with it. 

    In your case what you could do is;

    • Create a new measure in your chart
    • Give it the formula CVR1 * 1.05
    • Press OK, select the three dots and change the chart type of that measure to line
    • Rename the measure to Benchmark

    Repeat for Target line. Both lines will now be based on the value of CVR1 for that week and not be a static line.

    Hamza

     

4 Replies

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hey cmiller ,

    I dont know if the following is what you are looking for, but it can perhaps point you in the right direction. I do not know a lot of javascript so I tend not to meddle with it. 

    In your case what you could do is;

    • Create a new measure in your chart
    • Give it the formula CVR1 * 1.05
    • Press OK, select the three dots and change the chart type of that measure to line
    • Rename the measure to Benchmark

    Repeat for Target line. Both lines will now be based on the value of CVR1 for that week and not be a static line.

    Hamza

     

    • ajque's avatar
      ajque
      Cloud Apps

      Hello Hamza, 
      How about if there's a break by active on my chart (by agent), but still wants to see a dynamic benchmark line (not affected by the break by), that changes week by week? 

      I tried the above option but it deactivates automatically and retains one value once break by is activated. 

      Thank you for any suggestions. 

  • cmiller's avatar
    cmiller
    Data Storage

    This works perfectly! 

    Thanks so much for your help ðŸ˜€

  • Hello cmiller ,

    I’m following up because it looks like the solution offered by HamzaJ worked for you.

    If so, please click the 'Accept as Solution' button on their post. That way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.

    Thank you.