3 Replies Latest reply on Oct 9, 2018 12:56 AM by Roger Pouly

    Cannot get a total / average on my calculated field - What am I doing wrong ?

    Roger Pouly

      Good morning everyone,

       

      I'm here for a weird thing that have been happening to me in Tableau, mainly this :

       

       

      I get the same total everywhere when using the calculated field in question, and I cannot get it to display an average on lots of dimension.

       

      My relationships seem ok (I have the small icon like this )

       

      My calculated field do this : It checks if the client has left a review on Database1. If he has, it displays the review. If not, it checks the second database. If he has left a review, it displays it, if not, it searches from the third database etc...

       

      Here is the code (that works when I check a single sale) :

       

      IF ISNULL(AVG([Sheet1 (Database1)].[Overall rating]))=FALSE then AVG([Sheet1 (Database1)].[Overall rating])

      ELSEIF ISNULL(AVG([Sheet1 (Database2)].[Overall rating]))=FALSE then AVG([Sheet1 (Database2)].[Overall rating])

      ELSEIF ISNULL(AVG([Sheet1 (Database3)].[Overall rating]))=FALSE then AVG([Sheet1 (Database3)].[Overall rating])

      ELSEIF ISNULL(AVG([Sheet1 (Database4)].[Overall rating]))=FALSE then AVG([Sheet1 (Database4)].[Overall rating])

      ELSE NULL

      END

       

      Any idea ? I'm pretty stumped.

       

      Thanks,

       

      Roger Pouly