Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
chinnuchinni
Contributor III

how display top two projects

Hi all,

I have Four fields,say

   

YearProjectEmployeeHours
2016ABCRaj10
2016XYZRan30
2016PQRPawl20
2016MNRSonu40
2016LOSRonu25
2016KBWBanu60
2016RLZJoly75
2016SLPSinu80
2016CQRHony95
2016NBRWoly15
2016DSWBowl35
2017RSOGail75
2017LOSRaj95
2017KBWRan28
2017RLZPawl55
2017SLPSonu65
2017CQRRonu98
2017NBRBanu42
2017DSWJoly38
2017XYZSinu73
2017PQRHony68
2018MNRWoly99
2018LOSBowl24
2018KBWGail28
2018RLZRaj20
2018XYZRan10
2018PQRPawl62
2018MNRSonu19
2018LOSRonu29
2018KBWBanu43
2018RLZJoly35
2018CQRSinu26
2018NBRHony38
2018DSWWoly12

Required o/p:

 

YearProjectEmployeeHours
2016CQRHony95
2016SLPSinu80
2017CQRRonu98
2017LOSRaj95
2018MNRWoly99
2018PQRPawl62

thanks in advance.

1 Solution

Accepted Solutions
MVP
MVP

Re: how display top two projects

Try:

Aggr(If(Rank(Max(Hours))<3,Max(Hours)), Year, Project)

Capture.JPG

View solution in original post

5 Replies
MVP
MVP

Re: how display top two projects

Try:

Aggr(If(Rank(Max(Hours))<3,Max(Hours)), Year, Project)

Capture.JPG

View solution in original post

jyothish8807
Honored Contributor II

Re: how display top two projects

Hi Praveen,

Try like this:

if(Aggr(rank(sum(Hours)),Year,Project)<= 2,Aggr(sum(Hours),Year,Project))

For year 2018 i am getting different out put check the sample.

Br,

KC

Best Regards,
KC
jyothish8807
Honored Contributor II

Re: how display top two projects

I missed the max part

Best Regards,
KC
chinnuchinni
Contributor III

Re: how display top two projects

Hi,

instead of sum ,if we use max it will give proper output

Thanks You

chinnuchinni
Contributor III

Re: how display top two projects

Thank you Tresesco