Explore Courses Blog Tutorials Interview Questions
0 votes
in BI by (120 points)

i have a table where contains a row of a campaign, objective, and diverse costs by objective and according to the objective (traffic, reach, downloads, leads, etc) i need to generate this cost per objective (cpc,cpm, cpl,cpd), Example.

  •                               OBJECTIVE              CPC              CPM         CPL
  • campaig n1                traffic                      $1.15
  • campaig n2                reach                                          $3.43

So i tried to use a calculated field for each objective using conditional IF, but it generates an error due to i used IF and aggregated functions, this is my calculated field.

IF CONTAINS ([objetive], "traffic")

THEN sum[spend]/ sum[clics]  



How can i do this, without a error??

1 Answer

0 votes
by (22.5k points)

In most cases, tableau cannot mix row-level calculations and aggregated level calculations and if a single character is an aggregate all the fields must be aggregate same applies with IF condition as well

If you want to learn more about it Tableau, then go through this Tableau Training for more insights.   

Browse Categories