This is a follow-up article to my recent post about Section Access in Qlik Sense: Row and Column level security in Qlik Sense using Section Access. In this post I’m going to talk about how to handle Incomplete Visualisation errors that are caused by omitted fields in your security table.
When building your Qlik Sense applications, you may be required to hide sensitive information from specific users. In Qlik Sense this is controlled by a security table, in the form of section access. As well as row level security, administrators can also hide entire fields (applying column-level security). When a field is omitted from a user, but is still used in a visualisation within a Qlik sheet, this can cause Incomplete Visualisation errors. This is because, technically speaking, the developer has specified a field that no longer exists for the user; it’s been removed from the users session/app.
As Qlik developers we need to cater for this possibility when omitting fields. Outlined below is a non-exhaustive list of my top tips when it comes to visualising fields that may be omitted for a sub-group of users:
As you can see, these solutions all focus on utilising show/hide conditions. Let’s look at how these can be created.
The solution I typically implement involves building a list of the omitted fields. This involves adding a table at the bottom of the section application script which will include importing the data powering the Section Access table again, but this time with just the USERID and a new field containing the omitted field names:
By including the USERID, it will relate back to the section access table and limit the data to just the user’s records. By including the OMIT field, we can use this in an expression for determining whether to show the field/visualisation or not. In my sample application, the above create created the highlighted data island:
You may wish to tidy this up by storing the results in a variable or hiding the fields from view in the front-end using hidePrefix or hideSuffix. I’ll leave that decision up to you. Let’s continue with implementing the conditional expression. Here is an example of what I used recently:
This reads, if the field ‘DIM2’ or ‘Dim2’ is not omitted evaluate to true and show the field, otherwise evaluate to false and hide it. In this example we are checking for the presence of the field DIM2 which we are reliant on, but there could be multiple fields in complex expressions. Therefore, you may need to extend this further. Having said that, this expression could be used in the conditional show/hide of a Dimension or Measure in certain visualisations or in the calculated condition of the entire visualisation. When editing a visualisation with a conditional calculation, the Dimension/Measure will produce this warning when the condition evaluates to false, in this case meaning the field is omitted:
Hopefully this gives you some insight into one approach to solving Incomplete visualisations when working with omitted fields in section access. If you have another or better solution to this issue please do share them with us.
Topic: Data analytics