I am currently trying to count how many distinct users are active:
At least once a day
At least once a week
At least once a month
per month, for every month in the year.
Ideally the output will be like this chart that is attached
What I have done so far is following this instructions "13. User login frequency" (https://www.tableau.com/about/blog/LOD-expressions).
This example is not what I am looking for because this calculates an average in all the months of the year and I need to calculate per month how many users are active at least once a day, how many users are active at least once a week and how many users are active ar least once a month.
Thank you very much
Related
My company has a payroll program that prints payroll checks and pay stubs using Crystal Reports. The report selects payroll data from a table that has these columns: Hours, PeriodAmount, and YTDAmount. The hours are based on payroll period ending date. The report selects records based on a single pay period end date. So, hours would be selected for a single pay period only. However, we would like to print YTD hours on the pay stub. In other words, hours accumulated from beginning of year to current pay period. Since YTD hours is not a column in the table, would we need to include a sub report to accumulate hours? I don't think running totals would work since we are selecting a single period only. Any thoughts? Thanks.
Yes, a subreport is one option.
Another option is to select all pay periods in the current year and compute the total for the current period using a conditional total. For example, create af ormula that returns the hours if the record belongs to the current period and zero otherwise. Then, SUM that formula per employee. That SUM would give you the hours in the current period.
I have dashboard with a single stat panel showing the number of bookings for the current day. I need to show the same information (in order to compare) for the same of the week for last year on the same dashboard.
I know there is the "Time shift" feature in the panel but I don't want to set 364 days because I will not be sure to compare the same day.
Is there an easy way to do that?
Reagards,
If you're using InfluxDB/Flux you could timeShift your data independently from the Grafana UI.
In Cognos Framework, what should I use to retrieve week from a date instead of DATEPART? I do not want to follow ISO. I want 1/02/2016 to be Week 6.
If you want to follow a business calendar, you need to setup a calendar table. One record per date, each record has week number in Calendar year, and week number in fiscal year, and week number in month (calendar and fiscal). You can setup multiple calendars this way (for example if your marketing week is seperate from your accounting week, etc). Also a great place to setup relative date fields (which simplify alot of cognos reporting).
I got confused about some issues:
1: The one month duration of auto-renewable subscriptions is 30 days or does it depend on a natural month?
Because I can only test in sandbox mode,so the duration is just several minutes...
Maybe Apple just simply calculates it like this: 2013\01\15 -> 2013\02\15 -> 2013\03\15. If so,the second issue comes up
2: For example: I buy a monthly auto-renewable subscriptions at 2013\03\31 ,because 2013\04 only has 30 days, then what is the expires_date of my subscriptions? 2013\04\30 or 2013\05\01 or other date ?
It's adding 1 month, not 30 days. The number of days in 1 month varies. So purchasing a subscription on 3/31 would end on 4/30.
You can use NSDate, NSCalendar, and NSDateComponents to add a month to a date and see how long it will last. More info here: Modifying NSDate to represent 1 month from today
I can confirm this from my own app's data on both iOS and Android.
If someone purchases a monthly renewing subscription on, for example, the 15th of one month, then it will renew on the 15th of the next month, irrespective of how many days were in the month.
If someone purchases the subscription on the 31st of March, then it will renew on May 1st (because April has no 31st day, the renewal date will jump to the next available day in the calendar year - this also applies to February in a leap year, etc).
Given this, and assuming your app's primary income is from subscriptions, over time you should expect to see lower than average sales on the 31st of any given month because there won't be as many renewals. But it is no cause for concern as it is counteracted by the fact that you should expect to see higher than average sales on the 1st of any month that follows a long month anyway. Don't be dissapointed if you check your stats on the 31st of any month.
My actual documents are more complex than this but simplifying them like so will explain the problem I want to solve. I have daily and weekly documents.
Daily Document: ObjectId, Type, Count, Date
Weekly Documents: ObjectId, Type, Count, StartDate, EndDate
If I wanted a daily report I can run a query that will select documents with Date field value between range X to Y and Type equal to 'daily'. I can do the same thing for Weekly reports and it all works.
The problem:
For weekly reports if the start date is not the first day of the week and the end date is not exactly the last day of the week, selecting documents with Type 'weekly' will produce inaccurate reports since weekly documents store the data for the entire week. This may seem strange but Google Analytics lets you do it:
In the above screenshot Jul 3rd isn't the beginning of that week, nor is Jul 17th the end of that week. But Google Analytics lets you see the data as you want.
Possible Solution:
One possible solution is to produce a daily report for the overflowing days and subtract it from the weekly report.
The question:
Is there a nicer solution to solving the problem I described? I'm open to redesigning the documents
For weekly reports if the start date is not the first day of the week
and the end date is not exactly the last day of the week, selecting
documents with Type 'weekly' will produce inaccurate reports since
weekly documents store the data for the entire week. This may seem
strange but Google Analytics lets you do it:
Because they don't store documents like that.
The way this works (I reckon) is that Google just summerises the daily documents and ignores your "week" range and applies their own range of saying:
get as many full weeks as possible and aggregate the daily documents that
come under that range
and then:
Just throw the others ontop making each the end and start point
I wouldn't try to mix week and daily documents here I would just query over daily documents only and aggregate client side.