Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

dynamic title for chart

Hi,

I have a bar chart which lists the top 10 destinations in descending order. The chat title is "Top 10 Destinations". If user selects the top 4 ( or any number of destinations)  by selecting on the chart, i want to change the title to reflect the number of destinations selected. eg. Top 4 Destinations etc.

How can i get the number of destinations by taking user's selection on the chart?

8 Replies
danansell42
Creator III
Creator III

=if(getselectedcount(Destinations)<10,'Top '&getselectedcount(Destinations)&' Destinations','Top 10 Destinations)

Anil_Babu_Samineni

May be this?

='Top ' & Count(Destinations) & ' Destinations'

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

1.jpg

1780137d wrote:

Hi,

I have a bar chart which lists the top 10 destinations in descending order. The chat title is "Top 10 Destinations". If user selects the top 4 ( or any number of destinations)  by selecting on the chart, i want to change the title to reflect the number of destinations selected. eg. Top 4 Destinations etc.

How can i get the number of destinations by taking user's selection on the chart?

To elaborate further...

When the group of Top 4 destinations is selected ( by circling the bars in the chart), title becomes

2.jpg

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or maybe limit the upper boundary (because it is highly probable that the Dimension Limits tab has been activated or set analysis reduces the max number of dimension values):

='Top ' & RangeMin(Count(DISTINCT Destinations), 10) & ' Destinations'

Anonymous
Not applicable
Author

Hi Daniel,

Thanks for the tip. It works for me with the getselectedcount()

danansell42
Creator III
Creator III

my original solution was slightly wrong as if no selections were made then it would say Top 0 destinations.

I have fixed this now

=if(getselectedcount(destination)=0,'Top 10 Destinations',
if(getselectedcount(destination)<10,'Top '&getselectedcount(destination)&' Destinations','Top 10 Destinations'))

I've just tested and based on what you are asking for this works fine

Anonymous
Not applicable
Author

Hi Daniel,

Thanks for the quality check.  It's working well with your suggestion.

KP

Anonymous
Not applicable
Author

Hi Peter,

Thank you for the neat solution. learnt something today.