Skip to main content

Is there a way to do a diagonal slope reference line? Looking to build a regression slope based on discount vs total price. I can build a vertical or horizontal reference line but is there a way to do a regressive slope line that would provide a marker for values outside of the slope? Thank you!

 

Red line is what I want to build. 

 

#AskTheACExperts 

2 comentarios
  1. 24 jul 2018, 01:02

    Oops, linear regression takes 2 measures. Well, if you wanted to wander way outside of best practice you could fake a histogram as well. Instead of a grouping (or maybe in addition to in a stacked bar) you could break your stream into multiple streams for each breakpoint.

    In an example of 10 buckets, you'd run your query to establish breakpoints of max(myMea) - min(myMea) * 0.1, then 0.2, then 0.3 etc. Generate "01", "02", "03" as myHistogramBucket.

    Unioning way too many streams can result in performance issues, though I don't think it's explicitly limited. The more data, the faster you'll hit the 'lag barrier'. I've unioned 168 streams with 1 row each, but after more than a few columns, I exceeded the character cap on the query. This was also something I did in my free time and probably wouldn't recommend it for use in a real implementation.

    I've unioned around 15 streams with a few thousand rows in each without significant issue (again on my own, this time messing with 12 streams for months and a few others to do calculations). I don't know how this would work with large volume data.

0/9000