Data Studio Community Connectors: Combine time and non-time based metrics
up vote
0
down vote
favorite
I'm building a connector that connects to an API that offers endpoints for both time series-based metrics (such as 'number of users per day'), as well as static metrics (such as 'project status').
If I am to build a single connector, I would have to insert the static metrics within the time series values, right?
So, if my schema is
[{name=day}, {name=users}, {name=status}]
then my values would look like
['20181101', 150, '85%']
['20181102', 125, '85%']
['20181103', 134, '85%']
['20181104', 185, '85%']
['20181105', 111, '85%']
['20181106', 123, '85%']
since the 'status' field is not time-dependent.
While this seems to work, this looks pretty inefficient. Is there anything I'm missing, or should I build a separate connector for the static metrics endpoints?
Thanks!
google-data-studio
add a comment |
up vote
0
down vote
favorite
I'm building a connector that connects to an API that offers endpoints for both time series-based metrics (such as 'number of users per day'), as well as static metrics (such as 'project status').
If I am to build a single connector, I would have to insert the static metrics within the time series values, right?
So, if my schema is
[{name=day}, {name=users}, {name=status}]
then my values would look like
['20181101', 150, '85%']
['20181102', 125, '85%']
['20181103', 134, '85%']
['20181104', 185, '85%']
['20181105', 111, '85%']
['20181106', 123, '85%']
since the 'status' field is not time-dependent.
While this seems to work, this looks pretty inefficient. Is there anything I'm missing, or should I build a separate connector for the static metrics endpoints?
Thanks!
google-data-studio
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm building a connector that connects to an API that offers endpoints for both time series-based metrics (such as 'number of users per day'), as well as static metrics (such as 'project status').
If I am to build a single connector, I would have to insert the static metrics within the time series values, right?
So, if my schema is
[{name=day}, {name=users}, {name=status}]
then my values would look like
['20181101', 150, '85%']
['20181102', 125, '85%']
['20181103', 134, '85%']
['20181104', 185, '85%']
['20181105', 111, '85%']
['20181106', 123, '85%']
since the 'status' field is not time-dependent.
While this seems to work, this looks pretty inefficient. Is there anything I'm missing, or should I build a separate connector for the static metrics endpoints?
Thanks!
google-data-studio
I'm building a connector that connects to an API that offers endpoints for both time series-based metrics (such as 'number of users per day'), as well as static metrics (such as 'project status').
If I am to build a single connector, I would have to insert the static metrics within the time series values, right?
So, if my schema is
[{name=day}, {name=users}, {name=status}]
then my values would look like
['20181101', 150, '85%']
['20181102', 125, '85%']
['20181103', 134, '85%']
['20181104', 185, '85%']
['20181105', 111, '85%']
['20181106', 123, '85%']
since the 'status' field is not time-dependent.
While this seems to work, this looks pretty inefficient. Is there anything I'm missing, or should I build a separate connector for the static metrics endpoints?
Thanks!
google-data-studio
google-data-studio
asked 19 hours ago
Mihai A
31
31
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
It sounds like you are trying to merge two independent tables, from your description. If you have a time series data with dates, and a separate series of project status without dates, then split your connector to return two different series.
The method getSchema passes a request object, since it is beyond the getConfig() call. That schema can thus be split depending on the parameter. E.g.:
function getSchema(request){
switch(request.configParams.myTableOption){
case 'tableOption1':
return mySchemaObject.tableOption1;
case 'tableOption1':
return mySchemaObject.tableOption1;
}
}
Super simplified, of course, but that should provide a much more flexible connector, which can return different table types. You also have to similarly split getData() to return the right data, but that same configParam carries through subsequent requests for that connector, so you can rely on it to do so there as well.
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It sounds like you are trying to merge two independent tables, from your description. If you have a time series data with dates, and a separate series of project status without dates, then split your connector to return two different series.
The method getSchema passes a request object, since it is beyond the getConfig() call. That schema can thus be split depending on the parameter. E.g.:
function getSchema(request){
switch(request.configParams.myTableOption){
case 'tableOption1':
return mySchemaObject.tableOption1;
case 'tableOption1':
return mySchemaObject.tableOption1;
}
}
Super simplified, of course, but that should provide a much more flexible connector, which can return different table types. You also have to similarly split getData() to return the right data, but that same configParam carries through subsequent requests for that connector, so you can rely on it to do so there as well.
New contributor
add a comment |
up vote
0
down vote
It sounds like you are trying to merge two independent tables, from your description. If you have a time series data with dates, and a separate series of project status without dates, then split your connector to return two different series.
The method getSchema passes a request object, since it is beyond the getConfig() call. That schema can thus be split depending on the parameter. E.g.:
function getSchema(request){
switch(request.configParams.myTableOption){
case 'tableOption1':
return mySchemaObject.tableOption1;
case 'tableOption1':
return mySchemaObject.tableOption1;
}
}
Super simplified, of course, but that should provide a much more flexible connector, which can return different table types. You also have to similarly split getData() to return the right data, but that same configParam carries through subsequent requests for that connector, so you can rely on it to do so there as well.
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
It sounds like you are trying to merge two independent tables, from your description. If you have a time series data with dates, and a separate series of project status without dates, then split your connector to return two different series.
The method getSchema passes a request object, since it is beyond the getConfig() call. That schema can thus be split depending on the parameter. E.g.:
function getSchema(request){
switch(request.configParams.myTableOption){
case 'tableOption1':
return mySchemaObject.tableOption1;
case 'tableOption1':
return mySchemaObject.tableOption1;
}
}
Super simplified, of course, but that should provide a much more flexible connector, which can return different table types. You also have to similarly split getData() to return the right data, but that same configParam carries through subsequent requests for that connector, so you can rely on it to do so there as well.
New contributor
It sounds like you are trying to merge two independent tables, from your description. If you have a time series data with dates, and a separate series of project status without dates, then split your connector to return two different series.
The method getSchema passes a request object, since it is beyond the getConfig() call. That schema can thus be split depending on the parameter. E.g.:
function getSchema(request){
switch(request.configParams.myTableOption){
case 'tableOption1':
return mySchemaObject.tableOption1;
case 'tableOption1':
return mySchemaObject.tableOption1;
}
}
Super simplified, of course, but that should provide a much more flexible connector, which can return different table types. You also have to similarly split getData() to return the right data, but that same configParam carries through subsequent requests for that connector, so you can rely on it to do so there as well.
New contributor
New contributor
answered 9 hours ago
Alex D
1
1
New contributor
New contributor
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371621%2fdata-studio-community-connectors-combine-time-and-non-time-based-metrics%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown