3 Replies Latest reply on Oct 4, 2016 12:46 AM by Łukasz Majewski

    Calculated Field Quandary

    Gene Denny

      Refer to attached Excel file, which is only a sample.


      I have a SQL datasource with a table named testScore and a table named person.  The testScore table is organized like the Excel file attached and contains almost 8 million records.


      I would like to create a calculated field that ONLY refers to the rows of data where testID=3183 and testDate=6/17/2016.  I don't know how to translate the following into a statement usable in Tableau (version 10) and hoping someone can help.


      Here's what I am looking for:


      IF testID=3183 AND testDate = '2016-06-17' THEN scaleScore (this is the easy part)


      ELSE NULL (not so easy because the data doesn't exist in the testScore table)


      I only want it to return a <NULL> value if the testID=3183 and the data doesn't exist (in the attached sample, I would want to return <NULL> for personID=4 for example).  I have already performed a left join from the person table to the testScore table.


      I hope that makes sense. 


      Thanks for any help!