Display 20 curves in the same grafana panel 1 curve x user - grafana

I am using InfluxDB and grafana. I have a data for 20 users.
Here is the query I use to display a single user:
SELECT delta FROM "measures" WHERE user_id='23545296664228'
What I want is a panel in Grafana when I can display all 20 series ?
Ideally, it would be great to be able to display/hide series to focus on a specific one.
The goal, here, is to see if there is a specific user that behaves differently from others, and be able to visually identify him
Is it possible ?

Assuming user_id is tag in measures measurement you need to use group by in query like in this example:
SELECT delta FROM "measures" WHERE time > now() - 1d GROUP BY time(1h),user_id

Related

calculate difference between two queries in grafana

I have a grafana dashboard with 2 influx queries which calculate a single value (A and B)
I now need to calculate the difference between those to A - B.
Is this somehow possible within influx or grafana?
Note, the two values come from the same database but from different measurements
To show the difference of your two queries you first need to select the "Transform" tab.
Then "Add field from calculation".
Select your field names A and B.
Choose "Difference" as calculation method.
Select "Replace all fields" if you only want to see the difference.

Tableau filter based on multiple parameters?

I have some data like this below
data image see link
I would like to make a dashboard that will show you all the related empires based on what you choose (those that existed at the same time AND those in one of it's regions of influence). For example if I choose Rome then it will only show Egypt, Greek and Gaul and not show Byzantine because it is from a later time and not show China because it is in a different region. See below
See expected result picture in link
The simple way to achieve this task is to "Self-Join"
I would self-join the data again with Inner join on Region and Era
then, to handle the duplicate rows I would create a calculation
[Empire_Data1] = [Empires_Data2]
and put as false in the filter shelf.
then if you drag both Empires field you will the output you are looking for,
Since this is like 20 rows of data, you can perform a self join without any challenge.
But you have a lot of rows as in hundreds of thousands or more then, you might want to prep your data before connecting to the tableau.

Create histograms in Grafana with alphabetical values as x-axis

I need to create a dashboard to be used in a control room, where a bunch of operators will need to monitor the number of tasks assigned to other employees (among other aspects).
Source data will be coming from a RDBMs (PostgreSQL, in this case). We have people with assigned and numbered tasks that also have a status, and the DB data is like this (purely fictional: but it resembles the real one)
Having to create and mantain a dashboard i was thinking to use tools like Grafana, Kibana or similars, to plot something like this
The problem is that Grafana, for example, doesn't let me use alphabetical values for the x-axis. It only allow numeric values, while i've names to plot (Mark, Luke, Brian).
Is there a best practice than i can follow? Am i trying to use the wrong tools?
Actually solution is easier then you think although it also took me some time to figure it out. I will place here an example for some unspecified shop data grouped over countries - you just need to change it for your task. Example was tested on Grafana 5.0.3
PostgreSQL query for metrics
SELECT
$__time( partition_date ),
country as metric,
sum(value) as value
FROM
aggregations.my_data_for_dashboard
WHERE
shop = 'myshopname' AND
$__timeFilter(partition_date )
group by 1, 2
Grafana will show usual metrics:
In "Axes" tab look at "X-Axis" section, item "Mode" - switch "Time" to "Series" and Grafana will show bar chart for countries.

Tableau Pie-Chart with Measures

I have data with many measures values for each SiteID, i.e.
Total Windows Total Mac Total Online Total Offline Total Computers SiteID
I have been googling how to create pie chart in Tableau, but these tutorials assume I have data that looks like
OS Status SiteID
What I am ultimately trying to do is create a pie chart of online vs offline users and use actions from other data points to filter that chart.
I just need to know how to create pie-chart and from there I can create action.
If I understand your question correctly, it sounds like you want to make a pie chart showing online users vs. offline users, and be able to filter it by SiteID.
You could do this by:
Go to Marks and select Pie.
Drag [Measure Names] into Color.
Drag [Measure Values] into Angle.
Remove all pills except for [Total Online] and [Total Offline] from the Measure Values card.
Then you can create a SiteID filter by creating a quick filter, dragging SiteID to the filter card, or using an action from a dashboard.
Sounds like you need to reshape your data. Can you use SQL to do so?

Default range for date range filter in tableau

I want to set the default range on a date filter to show me the last 10 days - so basically looking at the lastDate (max date) in the data and default filtering only on the last 10 days (maxDate - 10)
How it looks now:
I still would want to the see the entire range bar on the dashboard and give the user the ability to modify the selected range if he wants to. The maxDate changes after every data refresh so it has to be some sort of a condition that is applied to the filter.
How I want it to look (by default after every refresh of data - new dates coming in):
Any suggestions on how this can be done? I know I can use the relative date and show the data for last 10 days but that would modify the filter and create a drop down which I don't want.
Any suggestions are welcome!
One simple approach that does most of what you want is the following:
Create an integer valued parameter with a range from 1 to some max
you choose, say 100. Call it say num_days.
Show the parameter control on your dashboard as a slider, and give
it a nice title like "Number of days to display"
Create a boolean calculated field called Within_Day_Range defined as:
datediff('minute', [My_Date_Field], now()) < [num_days] * 24 * 60
Put Within_Day_Range on the filter shelf and select the value true.
This lets the user easily select how many days in the past to include, and works to the granularity of minutes (i.e. the last two days really means the last 48 hours, not starting at midnight yesterday). Adjust the calculated field if you want different behavior.
The main drawback of this approach as described so far is that it doesn't display the earliest date possible in the database because that is filtered out. Quick filters do an initial query to get the bounds, which has a performance cost -- so using the approach described here can avoid that query and thus load faster.
If you really need that information on your dashboard, you could create a different worksheet to get just the min([My_Date_Field]) and display that near your parameter control.