Can you graph a time-series with continuously changing entries? - sql

How do I graphically represent a time-series where entries of this graph change over time?
For example I have a database of cities and their corresponding average temperature per day. I want a graphical representation of the ten hottest cities per day, and how they change over time. Do new cities appear on this list? Which cities drop out of this list?
Normally 6/10 of these cities will always be on the “top ten hottest” list, but sometimes a particular entry may spike up and join the top ten list. Is there a way to analyze the top ten list and compare it over time?
I’m having trouble thinking of a way to graph this because of the varying entries.

Your x-axis is day, but what's on the y-axis? Temperature? If so, you can have a different series (may be called something else depending on your charting package) for each city, and just add points to the series when it is one of the top ten for that day. This may require you to do some pre-processing on your data, in order to figure out which set of cities makes the top-ten list over your time frame.

In one of our widget implementations we have a setting for the time chart to display only top-n series, ranked by avg or last value. This was done to remove clutter by hiding too many unimportant series from the chart.
In your case why not show a bar for each period where the bar would contain top-N series for the period and a grey area for the remainder?

Related

Count number of rows with similar times

good afternoon. What is the point, the train has a geotag that determines its position in space. Location data is entered into a table. It is required to calculate how many times the train was at a certain point. But the problem is that being at a certain point, the geotag leaves several entries in the table by time. I wrote a query that allows you to count the number of arrivals, but the problem is that it works if you take only one train in the selection of values, and if you take several entries in a row, the query already counts incorrectly. Below I will attach a table and a written query
table
query1
if you select several train numbers, the values ​​are confused and are considered as one
Now I have this request, it counts the number of arrivals, but it counts incorrectly, if instead of several trains you specify only one in the selection, everything will be correct, what is my mistake ???
query2
I think you should use group by for address and zone.
By "train"| you mean adress?

SSRS Bar Chart Filtering Incorrectly

I am trying to create a chart showing the 10 highest-performing teams according to their "proportion of target achieved" score.
My dataset comprises every day worked by every individual in my organisation. The data is grouped in a stored procedure by month, team, job role, area of the organisation...
My SSRS report takes this data and sums it at a report level, based on a half-dozen parameters (mainly to the above groups).
The data is presented via a table, showing (for a given person/group/category) the hours worked, actual contact time (time with clients), expected contact time (time they're meant to spend with clients), and the proportion of their target they are achieving (actual contact time / expected contact time). All of this is reported for each of the last 6 months.
I.e.
I wanted to create a bar chart showing the 10 teams with the highest proportion of target achieved values. This variable is calculated in SSRS in order to allow for the data to be more flexible.
SSRS wouldn't let me use that calculation in a chart filter, so I added a denserank (called TeamOrder) for the teams in the stored procedure.
This is where the issue arises.
TeamOrder is used in the filter, and set to <= 10. 10 teams are displayed in the graph, but not the 10 that have values of TeamOrder equal to 1-10. The top couple are right, but in 10th position, for example, it's displaying the 32nd-best team.
Weirdly, when I set the filter to TeamOrder = [value], then it displays the one (correct) team (including the correct number 10 when TeamOrder = 10).
I'm at a complete loss as to what might be happening; any help would be enormously appreciated.

Best way to implement multiple continuous aggregates in postgres

Imagine you have to display information about rainfall based on cities over time.
You have tables the provides the details on how much it rains in a specific city for every hour. There is an endpoint that returns the average amount of rainfall for the timeframe/city requested.
(so imagine a table called rainfall_california, rainfall_texas, etc... I realize this schema isn't ideal for rainfall, but using it for an example.)
So instead of calculating the average on each request, I setup a continuous aggregate to calculate the average into a new view and have a policy to refresh the last hour of data once every hour.
ca_texas_rainfall_1_day
ca_texas_rainfall_7_day
ca_texas_rainfall_30_day
ca_california_rainfall_1_day
ca_california_rainfall_7_day
ca_california_rainfall_30_day
This works great and is super fast, but I'm a little confused on the best way to set it up. Should I have a different view for each continuous aggregate and each city? Wouldn't that result in a ton of different views? Or should I consolidate the average of each table into a single view?

How to represent data of one dataset using charjs as a stack group per day?

I work with Vue.js and chartjs , and I have several water consumption data at different times. I would like to represent this data as a stack group per day. But all the examples I found are made with at least two different categories of data. I would like a bar to be the concatenation of all daily consumption. Here is an example of representation that I would like to get with my data. I need help

Tableau - Adding dimensions together to show overall revenue

I am very new to Tableau (first day user) and have been a long time Excel user. I am trying to fully understand the power of Tableau to eventually move away from Excel.
I have a question concerning dimensions and creating a calculated field.
My table has multiple categories and sub-categories. My goal is to display the total revenue and average order value per chosen sub-category (this seems easy enough).
I want to then take those sub-categories and show a combined sum of revenue and average of the average order value. I am stuck on trying to also combine these sub-categories to show a blended view.
Furthermore, the 2 sub-categories are weighted very differently. The average order value of 1 has a much heavier weight than the other and will definitely affect the AOV when combined. How do you also assign a weight to this combined total?
Any help will be much appreciated. I know this may be a rather simple solution but I am new to the program and am having difficulty finding this answer.
Tableau screen:
or
img1 http://postimg.org/image/dq5wqgnyl/
Best,
CR
Put sub categories in the rows column.
Put sum revenue in the text pill in the marks section
In the analysis tab on the top select column grand totals.
I'm unable to see your images,i hope this answers a apart of your question.