Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theredpea/7a53e20618b3b3d07ea40f4b073c5058 to your computer and use it in GitHub Desktop.
Save theredpea/7a53e20618b3b3d07ea40f4b073c5058 to your computer and use it in GitHub Desktop.

In Qlik: Applying selection manually in some order; A later selection "trumps" an earlier selection i.e. selection on field at time t, will be trumped by subsequent selection on field at time t+1

But when saving a selection with Qlik bookmark The order that the selection appears in the Selection toolbar, will be consistent with load order, that is, the order shown in a Filter pane added to your Qlik app; whose field is the magic: $Field , and remove any other Sort Order (see resulting message "will show Load Order")

So current selections == load order

Separately, load order determines which gets "trumped" Therefore, current selections == precedence (which feels backward from the earlier rule; re "applying selection manually")

Using this data:

    LOAD Name,  Disney , Planet INLINE [
    Name, Planet, Disney
    Mickey, False, True
    Pluto, True, True
    Jupiter, True, False
    ];
    //WHERE Planet='True' XOR Disney='True';

First, make 2 separate bookmarks bookmarks in this selection order:

  • Planet = True, and Disney = True,
  • Disney = True, and Planet = True

Now re-apply each bookmark, note how the Current Selection bar does not match the order you selected in

Now modify load statement; uncomment the WHERE clause; this will exclude the row where Disney = True and Planet = True

Now, to decide which field is trummped, it will use the "load order" of the columns. In the above load script, Disney is first in load order, therefore Disney appears to the "left" in column order in Data Model Viewer therefore Disney appears top of filter pane with $Field , and all explicit sorting turned off therefore Disney appears first in current selection bar (if the True-True row is there), and therefore Disney would "trump" and prevent a selection on Planet (if the True-True row is not there)

Just switch the load order to give Planet precedence over Disney

    LOAD Name,  Planet , Disney INLINE [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment