5 Replies Latest reply: May 9, 2013 1:27 PM by acanelivehealthier RSS

    Is Aggr what I need, or something else?



      I'm trying to return BMI values for a user who ONLY have values in the year 2009 and 2010.  So my table would look like:


      LOAD * inline

      [     UserID, Year, BMI

            A, 2010, 24.5

            A, 2019, 22.1

            B, 2010, 20.2

            B, 2009, 18.8

            C, 2010, 19.2

            C, 2009,    -           ]


      So for example, user C wouldn't be in the cohort because they have no value for 2009.  I thought about using an if statement in the script, like...


      if((BMI <> Null() and [Screening Year]='2010')

                     and(BMI <> Null() and [Screening Year]='2009'), [External ID]) as [BMI Cohort],



      ...but when I create a table box to check my results, it doesn't seem to take out the folks who have null values.


      I also thought about creating a straight table with a calculated dimension using Aggr, but I'm not sure if this is what I need to do.  Any thoughts?