Crystal Reports 9 Graphs/Chart - crystal-reports

I have a cross tab with data showing clients per hour per day. So the rows are days of the week and the columns are the hours of the day, with the values being the number of clients.
Now to the main point :), I want to produce a graph for each day of the week, that shows the number of clients per hour for that day. So the report would have 8 graphs in total, one for each day and then an "all days" graph. See Picture:
Click, as I can't include pictures yet
Any idea how to do this, as I can't find a filter or anything, and the only graph I can get is all on one, with multiple bar lines for the days, in each hour block.

Ok, just figured this out :)
I have created a formula for each week day, that contains the following:
if {Command.day} = "Monday"
then {Command.kpi1}
else 0
Then in the chart expert, use this formula field for the values...so simple but overlooked :#

Related

How to display month and YTD data on same group band in Crystal Reports

I am working on a productivity report. I need it to display units for the month along with YTD units.
Example:
Month units YTD Units
Staff (group 1)
Accounting Period (group 2)
Service Category (group 2)
Detail - services with minutes that are calculated into minutes. This may or may not be hidden.
Service Category (footer) Units sum for period Total Units sum
Page Break
Accounting period.... and so on until we run out of accounting periods for that staff with services, then onto the next staff.
Units are being calculated in a formula field based off of minutes of the service. How can I accurately display the year to date units? Everything I've tried hasn't worked. Perhaps I'm doing a running total wrong but it told me I couldn't use a formula field in it (units). I hope my explanation makes sense.

Can I calculate a moving sum on a field in InfluxDB?

I'm trying to understand if it's possible to calculate a 1 month sum of revenue data in one of my measurements. For each day, I would like the sum of the previous 30 days.
Is this possible in InfluxDB or through Grafana's query interface?
A moving average is a moving sum, divided by the number of samples. So if you want a moving sum of the past 30 values:
select 30*moving_average(field_name, 30) from measurement
Edited to add:
As Peter Halicky points out in the comments, this is is not the past 30 days. It's the past 30 data points.
If you will always have data for every single day, it's not an issue.
If you're missing a day's data, you'll still get a 30-sample average, but it'll stretch over 31 days instead of 30.
If you don't actually care about the calendar, but want to know the past 30 days of activity, this is not a problem.
If it is a problem, there are a few work-arounds. One that's probably trickier than it sounds: ensure that there is always an entry for each day.
A more robust way is to have the reporting app do this in two steps. Something like this (haven't worked out all the details, but you get the idea):
find the number of data points in the past 30 days, using a query like select count(field_name) from measurement where time > now() - 30d.
Use this number (call it n) to form the query: select n*moving_average(field_name, n) from measurement where time > now - 30d.
Yes, definitely it's possible.
Just set this part of your query like this:
SELECT sum("value") FROM "YOUR_TAG_NAME"
WHERE $timeFilter GROUP BY time(30d) fill(null)
Just make sure that your dashboard time included Last 30 days (at least).

Trying to Average number of accounts by hour, day of week, and month

I'm in healthcare and we're trying to assess the number of discharges we have per hour of day, but we'd also like to be able to filter them down by day of week, or specific month, or even a particular day of week in a particular month (e.g. " what is the average number of discharges per hour on Mondays in January?")
I'm confident that Tableau can do this, but haven't been able to make the averages show up in my line graph... every time that I convert it from COUNT to AVG, the line simply goes straight. I got close when I did a table calculation to find the Average (dividing the count per hour by the number of days captured in the report), but when I add a filter for either the month or day of week, selecting one of the options of the filter reduces the total number that is being counted, rather than re-averaging the non-filtered items. (i.e. if the average of the 7 days of the week is "10" for a particular hour, and I deselect the first three days of the week, it's now saying that my average for that hour is roughly 6, despite the fact that all of the days are very close to 10 at that hour.)
Currently, my data table has the following columns:
Account#/MonthYear/HourOfDay/DayOfWeek
ex.12345678/ Jan-17 / 12 /Sunday
I would just create a few calculated fields to differentiate the parts of the calendar you might want to filter/aggregate on. Mixing the month and day of the week with filtering is pretty straight forward with the calculated fields. Then do standard summing to get what you are looking for because an average count of records is always one unless you are throwing some other calculation into the mix. I threw a quick example up on Tableau Public for you to get the idea.

Tableau: Four week moving average, first four weeks

Setting
As I'm sure many of you do in your vizs, I use date parameters for my data. This is great for creating trend analyses and all types of time series representations. Currently I'm using a line graph to show our sales hit rate history.
Picture
Question
The problem I'm running into is in creating a four week moving average. As you can see the four week moving average doesn't become just that until four weeks in! This creates quite the problem for me. What methods will enable the average at t=0 to show the average for the preceding four weeks?
Formula Used
This is my formula for creating the four week moving average:
WINDOW_AVG([Hit Ratio],-27,0)
Remove your date filter and try:
IIF(ATTR([DATE_FIELD])<T=0,NULL,WINDOW_AVG([Hit Ratio],-27,0))

How to I get the running total from a graph?

Im working with SSRS 2008. I have a bar graph showing me the defect counts. I am showing them with ranges from days to weeks or even months. Above it I want to show how many defects are actually being shown. For example if I show a range for two days. On day one there was 3 defects. Then on day two there are 2 defects. As you can see the total is 5 defects over the two days. What expression could I use that will bring back this value?
Thanks in advance
Zack
You can use RunningValue in your Value Expression:
=RunningValue(Fields!DefectCount.Value,Sum,"YourDataSetName")