-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Need help] How to create report with Hour (1 .. 24 hours) in Y axis and Date(Created At) in X axis #22
Comments
Hm, I'm unclear about exactly what data you want to see here. Below is a guess at what you want, but if it's incorrect, could you provide a similar ASCII chart indicating what you want?
The above shows the number of users created by hour of the day. To generate it, you would use a custom dimension: The custom dimension would be defined using raw SQL in your model (the following is for Postgres; you would have to adjust the SQL for other database technologies): class User < ApplicationRecord
include ReportsKit::Model
reports_kit do
dimension :hour_of_day, group: 'EXTRACT(HOUR FROM users.created_at)'
end
end The YAML would be similar to what's shown in the documentation: measure: user
dimensions:
- hour_of_day |
@tombenner, thanks a lot, I will try it and get back to you. |
@tombenner, your ascii representation is correct. For us as you can see above created_at is in IST. The hours should have been 2, 5, 4, 12 but we are seeing 11, 9, 6, 12, 8. Also graph is ordered based on count in ascending order rather on hour/day. Where do we need to modify the code to get day/hour ordered and proper hours which are in IST ? Thanks. |
Hi, I would like to get reports for each days currently, it show reports for 7 days. how should I write in dimensions: ? and also for the aggregation of amount for each days, how to achieve it?
in model
|
Hi,
I would like to create report where I need to know how many users created in which hour of the day.
Ex: If 2 users created at 1:10 pm and 1:20 pm, then I would like to show them on the map between 1 and 1:30 pm.
Usecase is to find the busiest hours of the day.
Thanks.
The text was updated successfully, but these errors were encountered: