4 Replies Latest reply on Mar 22, 2018 8:30 AM by Katie Boldensmith

    Calculated Field is Producing Both Null and Non-Null Values

    Katie Boldensmith

      Hi All,


      I'm a Tableau Newbie and this is my first post on the forum! I have a dataset that I need to reshape and I'm not sure how to go about it. My original dataset looks like this:



      And I need it to look like this:



      I tried making calculated fields for the columns I want:


      Literacy Teacher

      IF [Subject] = 'Literacy' THEN [Teacher Name] END


      But the IF statement of course produces both Null and Non-Null values:



      How can I collapse these values down so that each student just has one row? I can't use a filter to remove the nulls because then I'll lose students altogether. My data source will be a SQL Server view, so (if I understand correctly) pivoting won't be an option. Maybe Custom SQL?


      I'm using Tableau version 10.5


      Thanks in Advance!