Color highlight

QlikView's natural behavior is to zoom in on the data once a selection is made. However, there is a great downside to doing this: you lose some context because the rest of the elements disappear. One of the most popular ways to overcome this phenomenon is to mix color functions with our good old friend—Set Analysis.

Example: NBA standings.

Relevant features: Set Analysis and color highlight.

Color highlight

To create this visualization, you can do the following:

  1. Create a classic bar chart using Team as the dimension and sum(Wins) as the expression.
  2. This trick is based on two parts. First, we must work with the colors so that only the possible teams are highlighted. Then, we must ensure that even though the user selects just a couple of teams, the chart always displays all of them.
  3. Let's move on to the color. Go to the Expressions tab and click on the Expression Expansion icon.
  4. Locate the Color Background parameter and add the following formula:
    =if(match(Team, concat(DISTINCT Team, ',')),RGB(130, 170, 190), ARGB(45, 130, 170, 190)) 

    Note

    This expression starts by creating a list of the possible teams (the white and green items in a list box) with a concat() function:

    concat(DISTINCT Team, ',')   >   Cavs, Bulls, Bucks, Pacers, Pistons

    After that, there's a match() statement evaluating whether each team is in that list or not. If the result is positive, it assigns the bright color. Otherwise, it assigns the transparent one.

  5. As you can see, whenever you make a selection, the related teams are highlighted. However, the rest of the teams disappear immediately, so our color trick will be futile unless we can force all the teams to be plotted even if they are not related. In order to do this, let's modify the chart's expression as follows:
    sum({$<Conference=, Division=, Team=>} Wins) 

    Note

    The Field=, syntax in Set Analysis tells QlikView to disregard the selections made on those fields.

  6. Perfect! Now, we can clearly see where the related teams stand without losing the context given by plotting the entire league.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset