4 Replies Latest reply: Aug 30, 2018 7:13 AM by Andreas Jensen RSS

    Combing IF-statement with Aggr()

    Andreas Jensen

      Hi,

       

      I'm using the code below to identify the top five performers and now I want get the average of those top five performers.

       

      If(Rank(TOTAL SUM({$<

      [CompanyName]=,

      [XBRL Reporting year]={$(vXBRLThisYear)},

      industry={$(vChosenIndustry)}>}

      [Årets resultat]))<=5,

      SUM({$<

      [CompanyName]=,

      [XBRL Reporting year]={$(vXBRLThisYear)},

      industry={$(vChosenIndustry)}>}

      [GrossResult]))

       

      I have tried an aggr() function, but have not managed to succeed.

       

      Does anyone have idea how to get the average value of top 5?