Current Selections in a Qlik Chart Title

  • How-Tos FAQs
  • November 24, 2020
Get Started Transforming Your Data in Snowflake - feature img

Current Selections in a Qlik Chart Title

You have created a chart, and you want Current Selections of something displayed in, or as the Chart Title, dynamically.

What does that mean? For example, I have a chart displaying sales across all States, but when a user selects a state, I want the title to show the selection.

It is effortless and easy to apply by simply placing ( =State ) as the expression in the dialog box for the title. And if the user has selected a single State, it works fine, but when the user selects multiple states, it goes blank.

It is because the result is received from Qlik is either a String or a Comma Separated Value (CSV) .

The title box will only display a String.  So we need to convert the CSV into a String.


Converting CSV result to a String using Concat

The syntax:

Concat ([ distinct ] string [, delimiter [, sort-weight]])

The separator in multiple selections will always be a comma (,)

= Concat ( distinct State, ', ' )

By including Distinct, we ensure that all duplicates are removed.

Suppose the Chart is a Sales Chart, if we want to display the Titles displayed, in Order of Highest to Lowest Sales Values, we include the sort-weight the string returned is sorted according to the dimension SalesAmount

= Concat ( distinct State, ', ', SalesAmount  )

“But what about when the user has a vast selection of the specified field? How can I limit the output?”  Well, there’s the natural shortcut method to use Left() and limit the number of characters displayed, but that’s not elegant.. Instead, Rank the results to limit it to the top 3, for example.

Using Rank() in conjunction with concat() to limit results

Rank() used to return the top three performing States (based on SalesAmount) and string them together.

=Concat (IF(aggr(Rank(sum(SalesAmount)),State)<=3,State),',')

Sales performances are a natural and straightforward place to implement this. Still, you may wish to use the same logic for Counting outstanding trouble tickets or automated to-do lists and performance management items. In dashboards, this same contact method can limit the display to the top performers in a simple and managed display.

Up Next: Learn Qlik Sense Mashups

Related Posts


Qlik Number Formatting within Expressions

  • How-Tos FAQs
  • November 9, 2020

Qlik Date Conversion for SAP

  • How-Tos FAQs
  • October 28, 2020