Line Chart, Average instead of Sum
Can I make it so that the line chart does an average across all rows instead of a sum?
Below is the graph that I would like to show. However, I want the user to be able to download the data directly from this chart that includes a deeper breakdown of the red and orange averages here.
Here is the SQL I use to create the above chart.
When I uncomment warehouse name, I get the below chart. Notice how the hours are now in the thousands. This is because it is summing all of the averages instead of averaging the averages. How can I average the averages in the visualization while still keeping the level of detail in the csv download? I do not want to create a second table that the user has to look into to see the extra detail.
Any help is appreciated!
Jonathan Edwards looks like you would want to use a window function here! https://docs.aws.amazon.com/redshift/latest/dg/r_WF_AVG.html Most forms of SQL, aside from MySQL, support window functionsReply