2 Replies Latest reply on Aug 31, 2016 11:56 PM by Mahfooj Khan

    Age Count

    Govind Ramchetty

      HI

      I have 1 measure like Age

       

      Age

      4

      10

      12

      50

      20

       

      When i select my date from date: 1/1/2015 To:31/1/2015 means my count should be Age-2

      If  i select my date from date: 1/1/2016 To:31/1/2016 means my count should be Age-1

      IF  i select my date from date: 1/1/2014 To:31/1/2014 means my count should be Age-3

       

      How can i achieve this.My selection date will change based on user selection.

       

      Thanks

      Govind R

        • 1. Re: Age Count
          Mahfooj Khan

          This can be done. Kindly share a sample workbook in .twbx format. Till then you can write IF..ELSEIF..ELSE..END statement to get this. Try this

          IF ATTR([Date])>=#1-1-2014# and ATTR([Date])<=#31-1-2014# then SUM([Age])-3

          ELSEIF ATTR([Date])>=#1-1-2015# and ATTR([Date])<=#31-1-2015# then SUM([Age])-2

          ELSEIF ATTR([Date])>=#1-1-2016# and ATTR([Date])<=#31-1-2016# then SUM([Age])-1

          END

           

          Let me kno If you've any query.

           

          Mahfooj

          • 2. Re: Age Count
            Mahfooj Khan

            To make your selection dynamic you've to use parameter. Create two date parameters lets say Start Date and End Date using your Date field. Then you can place the Parameters in the above if...elseif statement.