Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
varma8998
Contributor III
Contributor III

Top Three values in Text & Image Charts in Qlik Sense

Hi All,

 

By using set analysis how can we show the top three values in Text Chart,

1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Glad to help you. Please close the topic with cheking "accept as solution".

View solution in original post

16 Replies
sergio0592
Specialist III
Specialist III

Hi,

Tops 3 sales values, you can just use :

=max(Sales)&','&max(Sales,2)&','&max(Sales,3)
varma8998
Contributor III
Contributor III
Author

Hi Sergio,

Thanks for the info but I need the data by using Set analysis

example if I am calculating in this way I am getting the values =max(Sales)&','&max(Sales,2)&','&max(Sales,3)

but I want to calculate in the below format

(Sum({<Currency = {"Constant"}, Scenario = {"Loss"}, Code = {"12345"}, Year = {"2018","2019","2020"}>}Amount)

-

Sum({<Currency = {"Constant"}, Scenario = {"Gain"}, Code = {"78965"}, Year = {"2018","2019","2020"}>}Amount))/1000000

I want to show the top three regions

Output I  need like below

Asia : USD XXXXXX Millions

France : USD XXXXXX Millions

Germany : USD XXXXX Millions  

 

Thanks in Advance

sergio0592
Specialist III
Specialist III

In a text box, try with :

=Concat(aggr(if(rank((Sum({<Currency = {"Constant"}, Scenario = {"Loss"}, Code = {"12345"}, Year = {"2018","2019","2020"}>}Amount)
-
Sum({<Currency = {"Constant"}, Scenario = {"Gain"}, Code = {"78965"}, Year = {"2018","2019","2020"}>}Amount)))<4,Country),Country),', ')
varma8998
Contributor III
Contributor III
Author

Hi Serigo ,

 

Still not getting the output

varma8998
Contributor III
Contributor III
Author

I got the ouput like this:

Germany, France, Asia

 

But I need the output like

Germany : USD XXXXX millions

France : USD XXXXX millions

Asia : USD xxxxx millions

 

Please help me with this

sergio0592
Specialist III
Specialist III

You want the ouput in a text box or in a chart?

varma8998
Contributor III
Contributor III
Author

in the Text box

in the Qlik sense there is a chart name called "A Text & Image" I want the output in this

sergio0592
Specialist III
Specialist III

In a text box , try:

=Concat(aggr(if(rank((Sum({<Currency = {"Constant"}, Scenario = {"Loss"}, Code = {"12345"}, Year = {"2018","2019","2020"}>}Amount)
-
Sum({<Currency = {"Constant"}, Scenario = {"Gain"}, Code = {"78965"}, Year = {"2018","2019","2020"}>}Amount)))<4,Country&' : USD '&
(Sum({<Currency = {"Constant"}, Scenario = {"Loss"}, Code = {"12345"}, Year = {"2018","2019","2020"}>}Amount)
-
Sum({<Currency = {"Constant"}, Scenario = {"Gain"}, Code = {"78965"}, Year ={"2018","2019","2020"}>}Amount))),Country),chr(10))

varma8998
Contributor III
Contributor III
Author

HI Sergio,

Thanks a lot it is working fine now