Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Graph Display - Top 5 *and* only positive values?

Hi all -

I have some graphs where I would only like to display positive values, and only show the top 5 values.  I know you can do each of these individually in Dimension Limits, but how do you do both at once?  I tried Set analysis for expressions, but couldn't figure out the syntax to only include values greater than 0.  Thanks!

1 Solution

Accepted Solutions
ecolomer
Master II
Master II

6 Replies
ecolomer
Master II
Master II

Here you have an example

if you need only positive values use function fabs()

Not applicable
Author

My apologies - the title said chart, but I'm actually referencing a graph (sand chart).  Because there are a lot of values to show, we want to limit the number of graphed segments to 5.  Unfortunately, some of the data behind these segments is negative.  From a data perspective, this is correct, and we do not want the absolute value of the function.  We just don't want the negative values to be factored in to the sand chart because QlikView's graphing capabilities freak out and draw very weird shapes when there are negative values.

ecolomer
Master II
Master II

you can also select the number or values with limitation of values of expression sorting descending and limit to 5 max values

Is this a solution?

ecolomer
Master II
Master II

See this example

Not applicable
Author

Enrique - the set analysis answer seems to have worked the best.  Thank you!

Not applicable
Author

Graph Display - Top 5 *and* only positive values?

we can use Rank() function ,get the Top 5 Values and  we can use RangeMax() function (or) set analysis we can get only Positive value.

ex: load * Inline [

Country,City,Product,Salesperson,Sales

USA,xxxx,Clothes,Joe,54900

UK,yyyy,Drugs,rajah,45000

India,zzzz,Plastic,Maya,48900

Pak,eeee,cots,ram,78900

newgeland,rrrrr,woods,jhon,90000

apgan,llll,stell,boby,56000

westindians,ffff,beds,kumar,-43900];

In the above table i want top  5 sales persons

=if(aggr(rank(sum(Sales),Product,Salesperson)<=4,Salesperson)

In Bar Chart,I want only display positive values

RangeMax(Sum(Sales),0)

or

sum({<Country={"=Aggr(sum(Sales),Country)>=0"}>}Sales)