6 Replies Latest reply: Feb 21, 2017 6:51 PM by Janek Lopez RSS

    How to get the last value per group

    Janek Lopez

      Hi

       

      First of all sorry for my bad english i hope you can understandme.

       

      I'm loading 3 tables in qliksense

       

      Projects

       

      (Identity)

      IdProject   ProjectName

      1               Project1

      2               Project2

      ...               .....  

      N               ProjectN

       

      Status


      (Identity)

      IdStatus   StatusName

      1               OnTime

      2               Paused

      3               Delayed

      4               Other

       

      ProjectStatusHistory

       

      (Identity)

      IdHistory     IdProject     IdStatus

      1                    1                1

      2                    1                2

      3                    1                3

      4                    1                1

      5                    1                2

      6                    2                1

      7                    2                2

      8                    2                3

      9                    3                1

      10                  3                2

       

      I need to show a table with the Name of the Projects who have the last status (bigger IdHistory) = 2 (paused)

       

      With the sample data the table should show

       

      Project1

      Project3

       

      Best Regards

       

      P.S. I've found some answers in the forum but they all use some "Group by" and "Max" at the data loading phase but i need to do this in a expression.