I am building reports with Eclipse BIRT and got to a problem with the scales of the x-axis. I am getting my input with a select-string out of a database table. There I have events from a Nagios-log-file, with timestamps for every events begin and end. Out of them I create a time like hh:mm, this is enough, it doesn't have to have the seconds or the date (These I select somewhere else). For every event I get a 1 or a 0, representing up- and downtimes.
Now I want to built the report so that I have the scaling of the x-axis for all 1440 Minutes of the day, just changing the state (to 0) when there is a downtime. I've already tried to format the scale, but it doesn't work at all. After days of searching and 'try and error' I am now asking for help. Is there a way to format the chart the way I need and how could it be done?
The last idea of mine was to have another table with every minute inculded from which I select the data and to update this table with the event-data from the nagios-log-table, but this doens't seem to be an adequate solution. Maybe there is something simple I am just not able to see right now.
P.S.: I am fairly new in this and the eclipse manual did not help me with this specific problem. I also know that there are easy, simply and amazing ways to get those kinds of report out of nagios, but I have to do it with BIRT...
I finally found a way to get the report the way I needed.
I am joining my data_table with "generate_series" to get the missing data for every minute.
The postgresql statement looks like:
select *, coalesce(updown, 1)
from generate_series ('19.12.2015 00:00'::timestamp, '19.12.2015 23:59', '1 minute')
left join data_table
on date_trunc('minute',to_timestamp(date_ts)) = generate_series
and host like '%host%';
This may not be the best way to do it, but it worked for me and maybe it is also helpful for others. To usw this with BIRT I just replaced the host and the dates with the parameter-sgn "?".
Related
is there a possiblity to create continuous timeline until today, even if today has no values?
I see in documentation we can fill missing gaps, https://documentation.sisense.com/7-1/creating-dashboards/additional-widget-designs/create-continuous-chart.htm#gsc.tab=0
but if there are no values, lets say last 3 days, there is nothing showed on the graph.
I would need to see the zeros also until the last day, not only for zero values between.
Is it possible?
Thanks
Edit: The documentation you linked is for v 7.1 which is quite old. Below is a similar topic for the latest version, but make sure you're looking at documentation for a version that is at least close to what you're running. If you're really on v 7.1, upgrading would be highly recommended.
https://documentation.sisense.com/latest/managing-data/working-with-data/handlenull.htm#gsc.tab=0
This may be something to report to Sisense, it seems like the 'show null as zero' feature would do exactly what you want it to.
A workaround could be to change the nulls to 0 in the data model. Implement this as a custom column if preferred.
Another possibility: Create a date dimension table that has all the dates and left join your data to this (matching date to date).
That way you won't have any gaps in days, and have 0s for the days where there are no entries.
This article from Sisense talks about when date dimension tables are useful (the example you provided with non-consecutive data but wanting to graph consecutively) and provides and excel file you can upload to create your date dim table.
https://support.sisense.com/kb/en/article/date-dimension-file
Okay, not the greatest title, but hopefully it covers enough. I will try to explain as best I can...
I have data going to InfluxDB that tracks how long that a specific action takes to respond and I want to add a Grafana chart that shows me the percent of actions that take over 1000ms but I'm struggling to figure that out.
InfluxDb Structure :
time = the time the request was made
last = the amount of time in ms the request took.
So for example, the following would chart the time each request took...
SELECT ("last") FROM "metrics"."autogen"."application_timer" WHERE time > :dashboardTime: AND time < :upperDashboardTime: FILL(null)
What I want though, is to track the percentage of requests that take over 1000ms. I'm extremely unfamiliar with Influx/Grafana so my pseudo code looks something like this...
select ((select count(last) > 1000) / (select count(last)) FROM "metrics"."autogen"."application_timer" WHERE time > :dashboardTime: AND time < :upperDashboardTime: FILL(null)
Could someone push me in the right direction with this? I'm sure its something simple, but I've read through a handful of tutorials on the internet and just can't seem to get my query right.
Thank you!
InfluxQL is not SQL, so you can't do that with your current data structure. See InfluxDB doc - https://docs.influxdata.com/influxdb/v1.8/guides/calculate_percentages/ where are also example data.
I have a query from another thread which goes through a list of different events and pulls out the most recent event and puts it into a list. The code I'm using is:
SELECT Cleaning1, Max(Date1) AS most_recent
FROM CleaningLog
GROUP BY Cleaning1;
Cleaning1 is the column that has the different cleanings, and Date1 is the column that has the date the cleaning occurred, and CleaningLog is the name of the table. I currently have a macro in Access which is an OpenQuery, query. I am having it open the above query, and then having it view as a data sheet and it's in edit mode.
What I am stuck on, is getting a subsequent macro/query/vba code to take the datasheet the query produces and going through each item and determining if they're over due to be cleaned. I tried having a Make Table query, but the problem is, there is no user friendly way to refresh that table without having to delete it (I am having unskilled workers use this Access sheet).
I am wondering if there's a way to look at the most recent cleaning's date, what the query produces, and filter the dates out that are over due for a cleaning, specified by a parameter. I have been looking at this webpage to start playing with the notation, but I haven't been able to come up with much that is useful.
https://support.office.com/en-us/article/Examples-of-query-criteria-3197228C-8684-4552-AC03-ABA746FB29D8
Another problem that I am encountering is that each cleaning doesn't have the same time frame in which is needs to be cleaned.
Thank you in advance for any help!!
You should just be able to modify the query above to show entries with a max date lower than they should be. Below shows entries that haven't been cleaned in 30 days, for instance.
SELECT Cleaning1, Max(Date1) AS most_recent
FROM CleaningLog
GROUP BY Cleaning1
HAVING Max(Date1) < Now() - 30;
I want to grab data from a KDB data base for a list of roughly 200 days within the last two years. The 200 days are in no particular pattern.
I only need the data from 09:29:00.000 to 09:31:00.000 everyday.
My first approach was to query all of the last two years data that have time stamp between 09:29:00.000 and 09:31:00.000, because I didn't see a way to just query the particular 200 days that I need.
However this proved to be too much for my server to handle.
Then I tried to summarize the 2 minute data for each date into an average and just print out the average, so now I will only have 200 rows of data as output. But somehow this still turns out to be too much. I'm not sure if this is because I'm not selecting the data correctly.
My other suspicion is that the query is garbing all the data first then averaging each date, which means averaging is not making it easier to handle.
Here's the code that I have:
select maxPriceB:max(price), minPriceB:min(price), avgPriceB:avg(price), avgSizeB:avg(qty) by date from dms where date within(2015.01.01, 2016.06,10), time within(09:29:00.000, 09:31:00.000), sym = `ZF6
poms is the table that the data is in
ZFU6 is the symbol that im looking for
I tried adding the key word distinct after select.
I want to know if there's anyway to break up the query, or make the query lighter for the server to handle.
Thank you!
If you use 32-bit kdb+ and get infamous 'wsfull error then you may try processing one day at a time like this:
raze{select maxPriceB:max(price), minPriceB:min(price), avgPriceB:avg(price), avgSizeB:avg(qty)
from dms where date=x,sym=`ZF6,time within 09:29:00.000 09:31:00.000}each 2015.01.01+1+til 2016.06.10-2015.01.01
I have created a Crystal Report for some of my users with a date range parameter set. The volume of information that the SQL command returns means that anything over a 7 day period in the date parameter slows the report to unusable speeds and subsequently locks the DB for all other users.
Does anyone know of a way to create a prompt in Crystal Reports that will appear before the parameter set? I.e. As soon as they select the report and click "Open", the first thing they see is a box saying "Please ensure a maximum 7 day date period". Then upon clicking "OK" or something of my choosing, they are presented with the parameter fields and can continue with the report.
If this cannot be done, is there a way to restrict the parameters so that when the users select the start date, they can only select a maximum of 7 days after.
The other option, if it is doable, is to have them select the start date and then it auto complete the end date with a date 7 days after the start date.
At the moment i have just added (Must be a 7 day period) to the parameter title but i dont feel this does a good enough job at advertising it and as soon as i publish it i know someone will want to get 4/5 years worth of data...our clinicians will be most unimpressed if they PAS system locks up during a busy clinic.
I have attached a screenshot of the kind of thing i am after. It is a little crude as it was done in paint but it gets the point across.
I have searched high and low for this solution so i am not sure it even exists, but am asking out of sheer desperation.
Thanks in advance,
Mike
If you use Crystal Report solely (not within a program like .Net app) you can select your latest proposition. Get start date and in your SQL command (View, Stored Procedure, ...) select items from startDate to startDate + 7 days.
Depending on your DBMS there are ways to add some value to date (like dateadd function in MSSQL).
So its done.