Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tableau api CTR表中的计算字段_Tableau Api - Fatal编程技术网

Tableau api CTR表中的计算字段

Tableau api CTR表中的计算字段,tableau-api,Tableau Api,我试图从包含数据值“1”或“2”(1=印象,2=点击)的维度“通知类型”创建一个计算字段。 我想计算CTR(点击率),即(点击/印象)*100。 除计算字段外的任何解决方案也值得赞赏。提前感谢。假设您的数据是每种通知类型一行,您可以执行以下操作: (sum(if [notification type] = "2" then [number of records] end) / sum(if [notification type] = "1" then [number of records] en

我试图从包含数据值“1”或“2”(1=印象,2=点击)的维度“通知类型”创建一个计算字段。 我想计算CTR(点击率),即(点击/印象)*100。
除计算字段外的任何解决方案也值得赞赏。提前感谢。

假设您的数据是每种通知类型一行,您可以执行以下操作:

(sum(if [notification type] = "2" then [number of records] end)
/
sum(if [notification type] = "1" then [number of records] end))*100

如果通知类型是维度(字符串),请在1和2之间使用引号。

不客气。务必将问题标记为已回答。