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: 
jimgibson
Contributor
Contributor

Need to graph the median

When I make a choice from a list box called Metric, I can see the value I have choosen in a text box by putting =GetFieldSelections(Metric) in the Text Box on the General tab of the Text Object.

I would like to graph the median of this value on a line chart. I cannot seem to get it to calculate the median of what I have choosen. I have tried putting these expressions in the definition of the expression on the Expressions tab but none of them produce anything. What is the correct syntax?

$(Median(=GetFieldSelections([Metric]))

$(Median(GetFieldSelections([Metric])))

Median($(GetFieldSelections([Metric])))

$(Median($(GetFieldSelections([Metric]))))

Thanks in advance

2 Replies
oknotsen
Master III
Master III

Help on Median function:

http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/ChartFunctions/StatisticalAggrega...

If you want to show a line at the level of the Median in your chart, go to the Presentation tab and add a "Reference Line" (bottom right corner).

Here is an example of the expression in a situation where you want to show the median of all Durations (metric) per YearQuarter:

= Median(aggr(sum(Duration), YearQuarter))

May you live in interesting times!
jimgibson
Contributor
Contributor
Author

You are not understanding my question.  The Dimension in my line chart is correct.  In this case I am using YearMonth.  The problem is what expression do I use on the expression tab to graph the metric they have selected in the list box.  I have tried a number of ways but none of syntax work.  I need to know what syntax I would use on the expression tab.

Thanks