Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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

11 Replies
anbu1984
Master III
Master III

vMinRuns=Min(runs)

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

vMaxWikcets=Max(wkts)

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

maxgro
MVP
MVP

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

1.jpg

Not applicable
Author

Hi Anbu,

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

Best Performance

d4  10/3

lironbaram
Partner - Master III
Partner - Master III

hi your expression should look like this

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

anbu1984
Master III
Master III

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

Not applicable
Author

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

anbu1984
Master III
Master III

=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)

lironbaram
Partner - Master III
Partner - Master III

hi then you can use

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

remember date is a number

maxgro
MVP
MVP

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