Lifelog API totals not matching up - sony-lifelog-api

I have been able to retrieve data from the Lifelog API and calculate all of the totals I need, but I am finding that the totals I calculate are different than the one's the Lifelog app is showing. Any idea what I may be doing wrong? Here is an example query I am running to get total steps:
/me/activities?start_time=2015-01-20T00:00:00.391-20&end_time=2015-01-20T23:59:00.000Z&type=physical:walk

The full guide on how to calculate totals is now available here:
https://developer.sony.com/develop/services/lifelog-api/guides/how-to-calculate-daily-totals/

Related

How to get the goal name or goal ID from Google Analytics in SSIS?

Is it possible to get the goal name or goal ID from the Google Analytics Source task (ZappySys) in SSIS?
I've been searching for it for a long time now and I just can't find it in the Dimensions or Metrics from the task.
I also tried to use the eventAction Dimension from the task, but the goalCompletionAll is not showing the same results from the website.
The Dimensions I've been using to compare are Source, eventAction and the Metric goalCompletionsAll.
You cannot get the name of the goal, but you can get the specific goal value through its id (that you can see in the panel) using ga:goalXXCompletions.
Also, you cannot compare event actions and goals because they are different scopes, the first is at the hit level while the second is at the session level, for this reason you get different numbers.

Limit the number of rows counted in in google data studio

I have a scorecard that looks at the number of URL clicks driven by all queries which works as expected. I am now trying to display the number of clicks driven by the top 10 queries in the scorecard. I was able to limit the number of rows in my table by disabling pagination to show only the top 10 queries but now I'm looking to sum the clicks in a scorecard to provide a quick summary rather than having a table.
I don't think what you want to do is possible dynamically via just the Search Console connector. Google Data Studio does not provide any way to calculate rankings via calculated fields, so there's no way for you to know which query is in the top 10 without looking at a sorted table. A few imperfect alternatives (roughly in order of increasing complexity):
You apply a filter so that the score card only aggregates values above a certain threshold. This would be hardcoded, so you would be filtering on the Clicks (ie aggregate all URL clicks above 100)
You apply a filter to the score card so that it only aggregates clicks from the top 10 URLs. This would not be a dynamically updating filter, so you'd have to look at the table to see which URLs are in the top 10, which would change as time goes on. This would end up being a filter like: "Include URLS Contains www.google.com,www.stackoverflow.com"
If you do not mind using google sheets as an intermediary, you could dump your Search Console data into a spreadsheet so that you can manipulate it however you like and then use the spreadsheet as the data source for data studio (as opposed to the Search Console connector). It looks like there might be some addons out there that you can use out of the box although I haven't used it myself, so not sure how difficult it is. Alternatively, you can build something out yourself via the Google Script and the Search Console API
You could build a custom Data Studio Community Visualization. (BTW just because they are called 'Community Visualizations' does not mean you have to make them publicly available.) Essentially here, you would be building a scorecard like component that aggregates the data according to your own rules, although this does require more coding experience. (Before you build one, check if something like what you need exists in the gallery, but at a quick glance, I don't see anything that would meet your needs.)

Does Apache Superset support Weighted Averages?

I'm trying to use Apache Superset to create a dashboard that will display the average rate of X/Y at different entities such that the time grain can be changed on the fly. However, all I have available as raw data is daily totals of X and Y for the entities in question.
It would be simple to do if I could just get a line chart that displayed sum(X)/sum(Y) as its own metric, where the sum range would change with the time grain, but that doesn't seem to be supported.
Creating a function in SQLAlchemy that calculates the daily rates and then uses that as the raw data is also an insufficient solution, since taking the average of that over different time ranges would not be properly weighted.
Is there a workaround I'm not seeing?
Is there a way to use Druid or some other tool to make displaying a quotient over a variable range possible?
My current best solution is to just set up different charts for each time grain size (day, month, quarter, year), but that's extremely inelegant and I'm hoping to do better.
There are multiple ways to do this, one is using the Metric editor as shown bellow, in this case the metric definition is stored as part of the chart.
Another way is to define a metric in the "datasource editor", where the metric will be stored with the datasource definition, and become reusable for any chart using this datasource, as shown here
Side note: depending on the database you use, you may have to CAST from say an integer to a numeric type as I did in the example, or multiply by 100 in order to get a proper result that's useful.

Calculating Average Weekly Traffic in Data Studio

I've got a table in Google Data Studio showing monthly traffic numbers and I would like to have another table that shows average weekly traffic based on the monthly numbers in another table on the same page.
Having some trouble figuring out the custom calculated field formula for this. Any help would be appreciated.
This seems to work for me.
SUM(Sales)/COUNT_DISTINCT((EXTRACT(ISOWEEK from DATE)))
From your example, is it not as easy as your monthly traffic numbers / 4.34?
Depending on how you want to present this, there's a pretty easy, and decent solution - Reference Lines.
Using a reference line, you can chart weekly values (ie: weekly sessions) on a bar chart, then via a reference line, you can plot 1 line for the average of that period (all the bars currently present). Because it is native to the visualization it will recalculate as you you filter!

Query for Adding integer data in azure search

Is there any provision to receive the searched result fields data summed up as a single integer
For example, if I am searching for 'x' person's bank details and I want the amount he spent using his credit card then the result I need is the sum of all credit card transactions
I couldn't find any documentation.
If we cannot add then what is the best way to approach?
Thanks for your help.
Unfortunately, Azure Search doesn't do any such calculation on the response. However, you can easily implement that on the client side with the response from the service.
Nate

Resources