Tableau api CTR表中的计算字段
我试图从包含数据值“1”或“2”(1=印象,2=点击)的维度“通知类型”创建一个计算字段。 我想计算CTR(点击率),即(点击/印象)*100。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
除计算字段外的任何解决方案也值得赞赏。提前感谢。假设您的数据是每种通知类型一行,您可以执行以下操作:
(sum(if [notification type] = "2" then [number of records] end)
/
sum(if [notification type] = "1" then [number of records] end))*100
如果通知类型是维度(字符串),请在1和2之间使用引号。不客气。务必将问题标记为已回答。