Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (17.6k points)

I have a problem with calculating CPC in Tableau. I have the cost and the number of the click but Tableau is not calculating the right CPC. the formula I used : [Cost]/[Click] I attached two tables in this request. first shows the table in which I calculated all KPIs in Zeppelin. the second the calculation in Tableau.

The whole data set has many null and 0 values, but it is the same data set used in zeppelin

enter image description here

The result of CPC is not correct in Tableau.

closed

1 Answer

0 votes
by (47.2k points)
edited by
 
Best answer
  • The problem seems to be that Tableau is using aggregate functions when you add measures, and in this case of CPC calculation, it's not correct.

  • Tableau is doing [cost]/[click] division (on row-level) and then simply averages all those numbers (you are basically calculating an average of an already average number).

  • What you are after is a bit different and you have to fix the math to make sure all costs are aggregated first and then divided by sum of all clicks, so:

SUM([cost]) / SUM([clicks])

  • This will give you the correct and mathematically sound numbers.

Get indepth knowledge about this field through Tableau Certification Course by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
asked Sep 28, 2019 in BI by chandra (29.3k points)
0 votes
1 answer

Browse Categories

...