Oracle Analytics Cloud and Server Idea Lab

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Return regression details from TRENDLINE() function

Needs Votes
26
Views
4
Comments
User_E02SU
User_E02SU Rank 2 - Community Beginner

Currently, the only two options for result_type are ('VALUE','MODEL'). If 'MODEL' is selected, it returns a long JSON string with the slope, intercept, some input parameters, and some regression metrics. This JSON string is not particularly usable in an OAC dashboard.

I would like to request the addition of more result_type options which return the details from the JSON 'MODEL' as numeric values:

  • SLOPE
  • INTERCEPT
  • STD_ERROR
  • R_SQUARED

Value

If I could extract the slope of the regression (at the level of partitionBy) then this calculation would become highly valuable for me in determining whether there is trending occuring in my data. Being able to return these metrics as numeric values enables sorting, filtering, and further calculations which are not possible today.

Example
I have a data set of power values for many devices which are categorized in platforms. I want to understand at the platform level if the average power of its racks is increasing, decreasing, or staying the same.

In other words, I am looking to fit a regression in order to calculate slope. When I use the TRENDLINE() function with result_type = MODEL, I can see the slope in the JSON. But this does not help me create a visualization or other columns because it is buried in the JSON.

image.png

I want to be able to enter the argument 'SLOPE' and have the highlighted numbers returned from the TRENDLINE() function as a numeric column which I could then sort and filter.

8
8 votes

Needs Votes · Last Updated

Thanks for submitting your idea. I've set it to Needs Votes so the community can vote on this idea.

Comments

  • Brendan T
    Brendan T Rank 6 - Analytics Lead

    could you elaborate a little more on what you'd like to see with an example.

    For example, are you proposing an addition result_type of 'SLOPE' and the return to be a number of some form, but do you need additional details and if so what

  • Thanks for submitting your idea. I've set it to Needs Votes so the community can vote on this idea.

  • User_E02SU
    User_E02SU Rank 2 - Community Beginner

    @Brendan T I wanted to post the example but didn't realize that I could insert pictures. Thanks for pushing me to try copy/paste😆
    What you described is exactly what I'm looking for. I've edited the description, let me know if this is clear.

    FWIW, I think it would also be valuable to be able to return the intercept, std error, and R-squared. I have left these out of the scope of my idea as I have no specific use case for them at this time.

  • Brendan T
    Brendan T Rank 6 - Analytics Lead

    I'd add those extras into the request (intercept, std error, R-squared). They might be used by most but they should be easy to add/included, with the benefit for those that need that level of detail