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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
NadjibBK
Contributor
Contributor

Ranking in bar graph

Hello everyone;

I hope you are all doing good.

Well, I have a ranking variable (input variable) which limit the number of values displayed in the bar graph; for example:

if the user enter X (X is an integer) in this ranking variable; only X  countries will be displayed in the graph.

My question is : how can I get these values (X country displayed) to use them as a filter in another expression.

Thank you in advance for your help.

 

1 Solution

Accepted Solutions
Saravanan_Desingh

One simple solution,

SET vRank=200;

tab1:
LOAD [Country or territory], 
     "IMF[1]" 
FROM
[https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)]
(html, utf8, embedded labels, table is [GDP (US$ million) by country])
Where IsNum("IMF[1]")
;

tab2:
NoConcatenate
LOAD RowNo() As Rank, *
Resident tab1
Order By "IMF[1]" Desc
;

Drop Table tab1;

commQV18.PNG

commQV19.PNG

Dimension:

=If(Rank<=vRank,[Country or territory])

 

Expression:

Sum("IMF[1]")

View solution in original post

1 Reply
Saravanan_Desingh

One simple solution,

SET vRank=200;

tab1:
LOAD [Country or territory], 
     "IMF[1]" 
FROM
[https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)]
(html, utf8, embedded labels, table is [GDP (US$ million) by country])
Where IsNum("IMF[1]")
;

tab2:
NoConcatenate
LOAD RowNo() As Rank, *
Resident tab1
Order By "IMF[1]" Desc
;

Drop Table tab1;

commQV18.PNG

commQV19.PNG

Dimension:

=If(Rank<=vRank,[Country or territory])

 

Expression:

Sum("IMF[1]")