11 Replies Latest reply: Dec 4, 2017 9:51 AM by Sunny Talwar RSS

    Use aggr() in a set expression

    omar bensalem

      Hi Qlikers ( stalwar1 )

      Suppose I have a column ID and a column Date

      example:

      ID , Date

      1, 2015

      1,2016

      1,2016

      2,2017

      3,2017

      3,2017

      3,2017

       

      I want to know, how many times each ID is present in its max(Date)

       

      I mean:

      ID, max(Date) by ID, count ID for its max(Date)

      1, 2016 , 2 times

      2, 2017 , 1 time

      3, 2017, 3 times

       

      To do so:

      I created a simple table:

      as a dimension:

      ID

      as measures:

      max(Date)

      and

      count({<Date={"$(=aggr(max(Date),ID))"}>} ID) : but this does not seem to work; am I missing sthing in the syntax/logic?