I'm looking for a way to import parts of it for a different analysis.
My biggest problem is here:
How to import data for a specific date range & itemid.
For example how to import CPCs for "Itemid12933" for date range 2018-02-15 to 2018-02-18
and store it into an object like this:
newdata = {
itemid: "Itemid12933",
CPC: ["2","3","4","4"]
Dates: ["2018-02-15","2018-02-16","2018-02-17","2018-02-18"]
It will pull up the CPCs and dates inside the object as arreys and store them one by one.
Is it possible to do it?
I'm sorry if the question is too specific!
Thank you.
Krzysztof
// Read flower / quantity / price data from a spreadsheet. In a real
// advertising campaign, you would have your own data source to read from.
function readFlowers(url) {
var flowersByName = {};
var spreadsheet = SpreadsheetApp.openByUrl(url);
var sheet = spreadsheet.getSheets()[0];
var data = sheet.getRange(2, 1, sheet.getMaxRows() - 1, 3).getValues();
for (var i = 0; i < data.length; i++) {
if (data[i][0]) {
var flower = {
name: data[i][0],
quantity: parseFloat(data[i][1]),
price: data[i][2]
};
if (typeof flower.price != 'string') {
// Spreadsheets will sometimes coerce "$4.99" into just the number
// 4.99. In that case, add the dollar sign back.
flower.price = '$' + flower.price.toFixed(2);
}
flowersByName[flower.name] = flower;
}
}
return flowersByName;
}Maybe I could read whole the column A (Date) and Column B (Prices) and look for the specific values using scripts?// The code below gets the values for the range C2:G8
// in the active spreadsheet.
var values = SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 4).getValues();
Logger.log(values[0][0]);