Google Analytics Acquisition Report shows negative change - google-analytics

I am generating google analytics Acquisition report and comparing previous 2 month to the current month. Although the numbers in the current month is higher, but google looks at it as a negative growth.
Isn't it suppose to be a positive change when it shows you have for example, you have more direct users? (Here is a screenshot)

The top right of your report probably look like this:
Note it says: May 1st to June 30th compared to July 1st to Aug 31st.
Percentage change is calculated by calculating the "change", change is calculated by using the current number subtracted by the number you're comparing to.
In this case, the current number is the number in the May 1st to June 30th period and the compared to number is the number between July 1st to Aug 31st. Which is about 26k and 27.8k respectively. Thus change is 26k - 27.8k = -1.8k
The percentage increase is calculated by change (-1.8k) divided by the compare to (27.8k) the number, which yields you -6.29% as shown.
If you want to show it being positive, you need to make the July 1st to Aug 31st your current period.

Related

Is it possible to print the official calendar week range and not just the available dates in my dataset?

I have a data frame which sums values over a weekly basis.
I am able to calculate the official calendar week that the summed values fall into in each case, but I want to know if I can add the calendar week range also for reference as some values only contain a couple of days' worth of dates for a particular week.
I currently use paste(min(created), max(created), sep = ' - ') but this only gives me the range of values with created and not the official calendar week range and can sometimes be misleading due to an incomplete weeks' worth of values being present in the dataset, as mentioned above.
Can an official calendar week range be achieved?

Assigning task to resource with increased working hours and reduced availability

I am facing a problem when I am assigning a one day task to a resource who works for 9hrs/day but with 25% availability. Following are the steps
Created a calendar with 9hrs as working hours (for all days) as shown below
Assigned availability to "Dummy" Resource as shown below
Created a 1 day task "Dummy" as shown below
Problem is
Work Column must be 2.25 hrs
Calculation: Dummy resource for 9hrs/day at 25% availability = (25/100)*9 hrs = 2.25hrs
but it is showing is 2.13 hrs
How to assign a long duration task (say 1 year) to above resource with different availability (as shown in image above). [Note: There are other resource who work for 8hrs/day with different availibility hence I cannot change MS Project "OPTIONS"]
I have created 3 calendars - CAL_1, CAL_2 and CAL_3 for 3 different locations. Each location has its own non-working days in each quarter. For example 15 weekdays are not working in Mar, Jun, Sept, Dec in CAL_1 every year. 10 weekdays in same manner for CAL_2 every year and so on. Is there any VBA script by which I can automate such work for every year (note: weekends are not included).

How to generate matched-pairs based on dates?

I have a dataset that includes dates and count of reports. I am tasked with generating matched-pairs using these guidelines:
Reports will need to be matched to the week immediately prior to or following. (For example: Jan 23, 2000 will be matched with Jan 16, 2000 and Jan 30, 2000)
Holidays must not be included in the final matched-pairs generation.
I have been able to identify the holidays within the dataset but am still stuck on how to generate the matched pairs. Any advice would be much appreciated!
Example of the Data
I am making assumptions as I could not ask for clarifications.
Assumptions I made
a> You wanted to get a formula bash
b> You wanted the date closest matching the previous week to the specific date. for example a Monday event needed to match closer to an event on Monday the previous week. As the data set you gave showed multiple reports through the week. It was not clear what pattern of the previous week you wanted to match.
Solution based on Assumptions.
1> You can mathematically turn each date to a grouping of which week they were in for the year. Then match them to one another. For example 1/1/2003 would be 1.1. A date in 14/1/2003 would be 2.1.
You can then patten match on if 1.1 = 2.1 if that hits it's a match if not it would loop until it saw an entry in the range of 2.[0-9]. You can place an if statment to check if there is a holiday on the match, if there is one it will continue the loop.

Tableau Weighted Average Per Capita Calc not aggregating right

I am trying to create a simple revenue per person calc that works with different filters within the data. I have it working for a single record, however, it breaks and aggregates incorrectly with multiple records.
The formula I have now is simply Sum([Revenue]) / Sum([Attendance]). This works when I only have a single event selected. However, as soon as I select multiple shows it aggregates and doesn't do the weighted avg.
I'm making some assumptions here, but hopefully this will help you out. I've created an .xlsx file with the following data:
Event Revenue Attendance
Event 1 63761 6685
Event 2 24065 3613
Event 3 69325 4635
Event 4 41996 5414
Inside Tableu I've created the calculated column for Rev Per Person.
Finally, in the Analysis dropdown I've enabled Show Column Grand Totals. This gives me the following:
Simple Fix
The problem is that all of the column totals are being calculated using the SUM aggregation. This is the desired behavior for Revenue and Attendance, but for Rev Per Person, you want to display the average.
In Analysis/ Totals / Total All Using you can configure the default aggregation. Here we don't want to set all of them though; but it's useful to know. Leave that where it is, and instead click on the Rev Per Person Grand Total value and change it from 'Automatic' to 'Average'.
Now you'll see a number much closer to the expected.
But it's not exactly what you expect. The average of all the Rev Per Person values gives us $9.73; but if you take the total Revenue / total Attendance you'd expect a value of $9.79.
Slight More Involved Fix
First - undo the simple fix. We'll keep all of the totals at 'Default'. Instead, we'll modify the Rev Per Person calculation.
IF Size() > 1 THEN
// Grand Total
SUM([Revenue]/[Attendance])
ELSE
// Regular View
SUM([Revenue])/SUM([Attendance])
END
Size() is being used to determine if the calculation is being done for an individual cell or not.
More information on Size() and similar functions can be found on Tableau's website here - https://onlinehelp.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.html
Now I see the expected value of $9.79.

Interval of one month back not working on the 31st?

Essentially, I have a query that is responsible for fetching all records (with specific filters) within the last month. I'm using Oracle's interval keyword and all was working great until today (December 31st, 2009). The code I'm using is
select (sysdate - interval '1' month) from dual
and the error I get it
ORA-01839: date not valid for month specified
How can I use the interval keyword to be compatible with any date? Or if anyone has a better way of approaching the issue, I'm all ears.
Thank you.
try
select add_months(sysdate,-1) from dual
Being pedantic...
The requirements are not quite specified perfectly unambiguously. What does the business mean by "within the last month"? Most people would take that to mean "within the current calendar month" in which case I'd use:
TRUNC(SYSDATE,'MM')
Otherwise, perhaps they want an arbitrary period of 1 month prior to the current date - but then how do you define that? As you've found, INTERVAL '1' MONTH simply subtracts one from the month portion of the date - e.g. 15-JAN-2009 - INTERVAL '1' MONTH returns 15-DEC-1999. For some dates, this results in an invalid date because not all months have the same number of days.
ADD_MONTHS resolves this by returning the last day in the month, e.g. ADD_MONTHS(31-DEC-2009,-1) returns 30-NOV-2009.
Another possibility is that the business actually wants to use an average month period - e.g. 365/12 which is approximately 30.4. They might want you to use SYSDATE-30, although of course twelve iterations of this will only cover 360 days of the year.

Resources