# Hi im building the Best Bowling figures expre...

(Shri) #1

Hi im building the Best Bowling figures expression for my app where i need to get the highest wickets taken with the least runs for those wickets.

for ex: in T20 if i have 5 wkts for 35 runs and 5 wkts for 40 runs then the formula should pick 5 wkts for 35 runs as the Best Bowling figures.

getting the MAX wickets is easy but what im not getting is the corresponding lowest Runs Given for that max Wickets Taken

Wickets and Runs Given are separate columns as i need them for other calculations.

im trying the following expression:

=Min(T20[Runs Leaked]).MAX(T20[Wickets Taken])

it doesn’t return the corresponding lowest runs for the MAX Wickets Taken, but it returns the lowest runs of all.

how can i correct this? thanks

(Philip Garrett) #2

@Shri

I am not sure I understand your question correctly, but if I do.

I would add a new Virtual column called “AvgRunsPerWicket”.

I would give it an AppFormula of: ([Runs Leaked] * 1.0) / ([Wickets Taken] * 1.0)

The 1.0 is there to ensure that you get a decimal result, rather than an integer one.

You can then look for the min or max value in “AvgRunsPerWicket” virtual column.

(Shri) #3

@Philip_Garrett_Appsh thanks for ur reply Philip

if i understand correctly ur saying use Runs Given / Wickets Taken as a pointer to the lowest runs.

yes if there are multiple matches where user has taken maximum of 5 wickets then i could use the average runs / wickets as a pointer.

but that may not work in a case where the user has taken 6 Wickets for 80 Runs. Here the average runs/wckt is 13.3 which is greater than 5 wkts for 35 runs which gives 7.

as in this case the Best Bowling is still 6 wkts for 80 runs as more wickets supersedes lesser runs.

so even if the player has given more runs, because he has taken the most wickets of any match, 6 for 80 is the Best Bowling.

this is the tricky bit which im stuck at

(Philip Garrett) #4

@Shri

I was hoping that there is some way to compute a numeric “rating” in which a higher “rating” reflects a better outcome. I hoped that a simple average would suffice, but I was wrong about that. I presume there must be some way to compute a “rating” that reflects what you want to measure.

Cricket is far too complicated for me to understand. I have no idea what the proper “rating” computation might be. Maybe one of our community members can do better.

(Shri) #5

@Philip_Garrett_Appsh cricket is complicated i totally agree.

the logic that im thinking is:

1. if there is a single maximum wickets taken then choose the corresponding runs given in that match. 2) if there are more than one match where maximum wickets taken are same then make a list of the runs given for those maximum wickets and choose the lowest amongst them.

how can

i put this into an expression?

(Shri) #6

@Shri this expression checks out but doesn’t give the desired result

=MIN(T20[Runs Leaked]).MAX(T20[Wickets Taken])

i am expecting the minimum [Runs Given] for the corresponding maximum [Wickets Taken] but it returns the overall minimum [Runs Given]