Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Calculate Median

Hi,

I have a table with the following:

GROUPCODESALESMEDIAN
12129284,6-
1229230,8-
12318461,5-
12463907,78.769
1257292,3-
1266553,8-
1277376,9-
12811076,9-
1296769,2-
12108307,7-
16269461,5-
162710984,69.342
16288461,5-
16299223,1-
173017076,915.077
173112923,1-
173215076,9-

I calculate the MEDIAN as an expression in my table as: AGGR(MEDIAN(SALES),GROUP). This is for every GROUP.

The thing is that I only get the value for 1 from the GROUP and I'd need to fill the nulls with the same value for the GROUP.

Like this:

GROUPCODESALESMEDIAN
12129284,68.769
1229230,8
8.769
12318461,5
8.769
12463907,78.769
1257292,3
8.769
1266553,8
8.769
1277376,9
8.769
12811076,9
8.769
1296769,2
8.769
12108307,7
8.769
16269461,59.342
162710984,69.342
16288461,59.342
16299223,19.342
173017076,915.077
173112923,115.077
173215076,915.077

How can I do that directly on my simple table?

Thanks

11 Replies
microwin88x
Creator III
Creator III
Author

Yes!!! Thank you very much! Worked like a charm!

To get the Median value fixed without getting affected by selections from other fields, should I add the following?:

AGGR(MEDIAN({<FIELD1=,FIELD2=,FIELD3=>} total <GROUP>SALES),GROUP,CODE)

Or do you know any other way instead of specifying all the fields to omit?

Thanks again!

devarasu07
Master II
Master II

Hi,


if you wish to ignore all field selection u can simply use Set identifier 1 or only specific field then use FIELD1= like that

=count({1<CODE= {"=sum(SALES) >= Aggr(Median(Total <GROUP>SALES),GROUP,CODE)"} > } CODE)


Thanks,Deva