Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

First sorted value() issue?

Hi All,

I got table as below

Name              runs         wkts

a1                   10               2

b2                   20                1

c3                   15               3

d4                    10               3

How to show best performance (most wkts and least runs) by name, using firstsortedvalue().

Regards,

Janaki

Tags (1)
11 Replies
Highlighted
Master III
Master III

Re: First sorted value() issue?

vMinRuns=Min(runs)

='Players with least runs : ' &Concat(If(runs = vMinRuns, Name), ',')

vMaxWikcets=Max(wkts)

='Players took most wickets : ' & Concat(If(wkts = vMaxWikcets, Name), ',')

Highlighted
MVP
MVP

Re: First sorted value() issue?

FirstSortedValue(TOTAL Name, -aggr(sum(wkts) - sum(runs)/sum(TOTAL runs),Name) )

1.jpg

Highlighted
Not applicable

Re: First sorted value() issue?

Hi Anbu,

I need to show out put like this in a text box.

Best Performance

d4  10/3

Highlighted
Partner
Partner

Re: First sorted value() issue?

hi your expression should look like this

=FirstSortedValue(Name & ' ' & Runs & '/' & Wkts,Runs/Wkts)

Highlighted
Master III
Master III

Re: First sorted value() issue?

=Concat(If(runs = vMinRuns And wkts = vMaxWikcets, Name), ',') & vMinRuns & '/' & vMaxWikcets

Highlighted
Not applicable

Re: First sorted value() issue?

Hi Massimo,

What if we got repeated Values like.

Name   runs    wkts      dt    FSV

a           10       2        1-3-15

b            20      1         1-2-15    

c            15      3        1-2-15

d            10      3         2-215    

e             7       3         1-2-15

f              7       3         2-2-15

who first scored has to come first.please help me on this

Highlighted
Master III
Master III

Re: First sorted value() issue?

=Concat(If(runs = Min(TOTAL runs) And wkts = Max(TOTAL wkts), Name), ',') & '   ' & Min(TOTAL runs) & '/' & Max(TOTAL wkts)

154458.png

If you want to pick player who scored first, try this

=SubField(Concat(If(runs = Min(TOTAL runs) And wkts = Max(TOTAL wkts), Name ), ',',Aggr(Max(dtFSV),Name)),',',1) & '   ' & Min(TOTAL runs) & '/' & Max(TOTAL wkts)

Highlighted
Partner
Partner

Re: First sorted value() issue?

hi then you can use

=FirstSortedValue(Name & ' ' & Runs & '/' & Wkts,Runs/Wkts+date)

remember date is a number

Highlighted
MVP
MVP

Re: First sorted value() issue?

this should works

FirstSortedValue(TOTAL Name, -aggr(sum(wkts) - sum(runs)/sum(TOTAL runs),Name) +dt/ max(TOTAL  dt) / 10000 )

but I don't like it very much

1.jpg