QlikView's Section Access can be used to reduce data based on the current user.
Environment:
QlikView
Qlik Sense Enterprise on Windows
Qlik Cloud
Qlik Sense Business
If the data reduction appears incorrect, the section access table content and logic need to be validated.
This validation can be done in two steps:
- Validate the Section Access table content, see article How To Validate Section Access Table Content
- Validate the reduction field, see below.
Load Section Access as a normal table
- Comment the Section Access keyword:
//Section Access;
- Comment the Section Application keyword
//Section Application;
- Reload the application
- Open table viewer (Ctrl+T)
- The data model now has a table consisting of the section access table, and this is linked to the data model.
NOTE: If the section access table links to the synthetic table, this approach will most likely not work.
Validate reduction field format
The reduction field must be in upper case to comply with section access requirements, see QlikView Reference Manual for details.
- Add a list box showing the reduction field
- Add an expression to the list box to indicate values not in upper case, for example as
Upper(FIELDNAME)<>FIELDNAME
- The incorrect format values will be indicated with -1 (TRUE), based on the logical comparison
Correct the incorrect format in reduction field
The incorrect formats must be changed to match the section access tables Upper case formatting. There are two possible paths to address the format.
- The reduction field is used in the presentation, and the format can not be changed due to presentation requirements
- During load create a duplicate of the reduction field. Keep the original field name, but add a prefix to indicate it is a key field.
- Force upper case on the new reduction field by using Upper() function
- Rename the reduction field in the Section Access table, to it matches the new reduction field name
- Reload the application
- The data model should now indicate a section access link over the new reduction field
- There is no need to change front end application, since the old reduction field still is the same
- The format of the upper field does not affect presentation or application expressions
- Force upper case on the new reduction field by using Upper() function
- Reload the application
Select the user to evaluate
- Add a list box showing the user names, either from USERID field or NTNAME field
- Add a list box showing the reduction field.
- Select the user that has unexpected results
- The available values in the reduction field will be the reduction linked to the user
- The current data set is no identical to the user's reduction value. Validate that the same issue exists as when the user logs in through section access.
- The reduction value is incorrect. Investigate further if the section access definition is incorrect.
- Sheet object calculation is incorrect. Evaluate if the expression is incorrect compared to the desired calculation.
- Sheet object calculation is correct. Consider if an alternate state or set expression is involved in the calculation. Notice that the current document has the full data set in memory, compared to a reduced data set through section access.