I have a query that runs just fine like this. It returns the right object and everything.
var all = new Keen.Query("extraction", {
eventCollection: "android-sample-button-clicks",
timeframe: 'previous_300_minutes'
});
But what I want to do is to do something like this. See how I use the time variable and insert it into the query for 'timeframe'? But then it always returns undefined.
if (this.value == "1"){
var time = 'previous_300_minutes'
} else {
var time = 'previous_30_minutes'
}
var all = new Keen.Query("extraction", {
eventCollection: "android-sample-button-clicks",
timeframe: time
});
This always returns undefined. I figure its because I cannot insert the time string variable into the query JSON like that. How can I insert this so that it is formatted correctly?