Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
pdlnfool
Contributor
Contributor

Sloped Reference Line Going to Zero

Good day all!

I am trying to add a measure to a chart to generate a sloped line or "glide slope" which starts at the value on the first date and goes to 0 at a certain date as shown in the graph below.  I hand jammed the values for the red line, but would like to use the same idea for other graphs, so using a function or formula would be ideal.  Even using a fitted line but forcing to zero would be fine.

pdlnfool_0-1663368269558.png

I'm thinking I could use the LinEst_M function and force the line to pass through the x-axis at the end date (when y is zero) but get a curved line and the y axis starting value is not correct.

pdlnfool_2-1663371920370.png

In another attempt, I divided the value from the first date by the number of weeks of data, which gives me the slope. I then multiplied the slope by the week number of data (week 1, week 2, etc) and subtracted that from the first value.  This gave me the correct values...

pdlnfool_0-1663373710877.png

 

But using the same formula in the chart causes a broken line for some reason.  It seems Qlik doesn't like the calculation with the Week() function.  To troubleshoot, I replaced the Week() function with a number and  the line is no longer broken (but obviously gives the wrong data).

pdlnfool_3-1663372154067.png

 

Any insight would be appreciated.  Thank you!

  Chris

Labels (1)
  • Chart

0 Replies