New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Contributor III

how display top two projects

Hi all,

I have Four fields,say

 Year Project Employee Hours 2016 ABC Raj 10 2016 XYZ Ran 30 2016 PQR Pawl 20 2016 MNR Sonu 40 2016 LOS Ronu 25 2016 KBW Banu 60 2016 RLZ Joly 75 2016 SLP Sinu 80 2016 CQR Hony 95 2016 NBR Woly 15 2016 DSW Bowl 35 2017 RSO Gail 75 2017 LOS Raj 95 2017 KBW Ran 28 2017 RLZ Pawl 55 2017 SLP Sonu 65 2017 CQR Ronu 98 2017 NBR Banu 42 2017 DSW Joly 38 2017 XYZ Sinu 73 2017 PQR Hony 68 2018 MNR Woly 99 2018 LOS Bowl 24 2018 KBW Gail 28 2018 RLZ Raj 20 2018 XYZ Ran 10 2018 PQR Pawl 62 2018 MNR Sonu 19 2018 LOS Ronu 29 2018 KBW Banu 43 2018 RLZ Joly 35 2018 CQR Sinu 26 2018 NBR Hony 38 2018 DSW Woly 12

Required o/p:

 Year Project Employee Hours 2016 CQR Hony 95 2016 SLP Sinu 80 2017 CQR Ronu 98 2017 LOS Raj 95 2018 MNR Woly 99 2018 PQR Pawl 62

1 Solution

Accepted Solutions
MVP

Re: how display top two projects

Try:

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

5 Replies
MVP

Re: how display top two projects

Try:

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

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
Honored Contributor II

Re: how display top two projects

I missed the max part

Best Regards,
KC
Contributor III

Re: how display top two projects

Hi,

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

Thanks You

Contributor III

Re: how display top two projects

Thank you Tresesco