我有一个Google电子表格表:
user | message_id | event | timestamp -------------------------------------------------------------------------------- john player | ekjf939e9313140_34k | delivered | 04/13/2018 12:56:30 john player | ekjf939e9313140_34k | opened | 04/15/2018 16:05:00 john player | ekjf939e9313140_34k | opened | 04/16/2018 22:15:20 john player | ekjf939e9313140_34k | opened | 04/16/2018 23:47:33 cristian dior | dsfsk0340344030fkjkj | delivered | 04/12/2018 18:45:21 cristian dior | dsfsk0340344030fkjkj | opened | 04/13/2018 15:40:17 cristian dior | dsfsk0340344030fkjkj | clicked | 04/13/2018 16:00:07 cristian dior | dsfsk0340344030fkjkj | clicked | 04/13/2018 16:04:10 cristian dior | dsfsk0340344030fkjkj | clicked | 04/14/2018 12:30:11
对于用户,对于每个唯一的message_id,如何创建一个Google电子表格数据透视表,该表可以显示从发送电子邮件到打开电子邮件之间经过的小时数?
答案 0 :(得分:1)
style
第一个查询是按事件调整列。 第二是计算差异。
结果:
<template>
<div>
<!-- THe below is valid -->
<img v-bind:src="$IMG_PATH + '/carousel1.jpeg'"/>
<!-- The below wont compile: has syntax errors? -->
<p v-bind:style="background-image: url('$IMG_PATH + \'/carousel1.jpeg\''));">Foo</p>
</div>
</template>
<script>
Vue.prototype.$IMG_PATH = './foo/img'
export default {
...
}
</script>
</style>
参考: https://developers.google.com/chart/interactive/docs/querylanguage
修改强>
对于多个事件,我建议修改公式:
=QUERY(
ArrayFormula(
QUERY({A:C,value(D:D)},
"select Col1, Col2, sum(Col4) where Col1 is not null group by Col1, Col2 pivot Col3")),
"select Col1, Col2, Col4 - Col3 label Col4 - Col3 'Time' format Col4 - Col3 'hh:mm:ss'")
它仅过滤所需的事件:user message_id Time
cristian dior dsfsk0340344030fkjkj 20:54:56
john player ekjf939e9313140_34k 03:08:30
干杯!