Download Set Analysis Primer

x

Data Brushing

I owe debt of gratitude to my friend, Dalton Ruer, for this blog post inspiration.

He often writes about data context with his signature phrase — Context is King.

That inspiration made me research useful functions that I can use for data brushing.

Brushing is the process of interactively selecting data items from a visual representation. The original intention of brushing is to highlight brushed data items in different views of a visualization. — infovis-wiki

Like some underrated Star Wars characters, Qlik has shiny functions that can do wonders if you can research and bring them to limelight.

I found one such underrated and relatively obscure function for data brushing — FindOneOf

FindOneOf() searches a string to find the position of the occurrence of any character from a set of provided characters. The position of the first occurrence of any character from the search set is returned unless a third argument (with a value greater than 1) is supplied. If no match is found, 0 is returned. — Qlik Help

Syntax:  

FindOneOf(text, char_set[, count])

Armed with the knowledge of this shiny function, we can deploy it by using it along with CONCAT function as a color expression to allow users to select multiple values to highlight within a bar chart.

Steps

Let’s first create a simple bar chart with a Country dimension and Sales as a measure.

num(sum(Sales),’$#,##0;-$#,##0′)

In order to not lose context when user selects one or multiple country values, let’s use bit of magic of Set Analysis.

num(sum({1}Sales),’$#,##0;-$#,##0′)

We simply added 1 as an identifier to ignore all user selections.

Color Expression

The star of the show is the color expression that will mesmerize your users.

if(FindOneOf(concat(Country, ‘,’) , getFieldSelections(Country)), ‘#4F4E51’, ‘#A4A2AA’)

With that stroke of a magic, you will be able to provide context for your users.

Are you ready to take your Qlik skills to the next level?

Benefits:

  • Get FREE access to all of our Qlik courses(18+) for one year
  • Get certification project and support

If you enjoyed this article, get email updates (it’s free).

* indicates required
About the author

1 Response