Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get the middle number or median

Hi Community,

I have a filed that has 1-,1,1+,2-,2,2+,3-,3,3+,4-,4. I have to find a value that is in the center of these.

If I use Median function, it doesn't return any thing for values such as 1-,1+,2-,2+.

Is there a different approach to get this.

I thought of putting these in a separate table and have id as one more field. So I can get the median of id's but how will I display the value associated with it. My expression is:

Median
({<
[Concat_FBI_FinancialRatio] = {"=rank(Count([Concat_FBI_FinancialRatio]))=1"},
[FBI Template Name (Fac Own)]= {"=rank(Count([FBI Template Name (Fac Own)]))=1"},
[FBI Financial Statement Date (Fac Own)]  ={">=$(=(date(AddMonths(Updated_Date,-12),'MM-DD-YYYY')))"}

>}
[FBI Grade (Fac Own)]))

1 Reply
sunny_talwar

Can you try this approach:

Table:

LOAD *,

  Evaluate([FBI Grade (Fac Own)]&If(Len(Trim(KeepChar([FBI Grade (Fac Own)], '+-'))) > 0, 0.25)) as NewField

Inline [

FBI Grade (Fac Own)

1-

1

"1+"

2-

2

"2+"

3-

3

"3+"

4-

4

];

Expression:

=Only({<NewField = {"$(=Median(NewField))"}>}[FBI Grade (Fac Own)])