If you're working with columns in Vizlib Writeback Table, it can be useful to display (or hide) a column if a certain condition is met. This article sets out how to use column syntax in an expression to hide or display columns. You can find other examples on working with expressions using column syntax here.
TABLE OF CONTENTS
Show Column If - Creating an Expression
Show column if (Figure 1) is a setting in Vizlib Writeback Table which you can find in the Data section of the property panel. It can be applied to each column separately, and is used to display a column only if a certain condition is met. The example in Figure 1 shows a column called Comments.
Figure 1: Show Column If
by either typing in the text field directly or clicking the function icon to open the expression editor. We've included an example here about hiding a column that does not need to be visible to every user. The expression uses a variable to create a condition that only displays the column Comments to users who have the permissions required.
Note: Qlik Sense Engine will reset variables values to their definition values when the app is reloaded and saved. Use a dimension instead of variables to control the visibility of columns, because selections are kept after reloading and saving.
The main benefit of using Show column if in this context is to only display certain columns when they are required, which makes the table more readable and improves the user experience.
You can use column syntax with Form View to show or hide column items inside a group. Enabling form view is a very useful approach if you're working with large sets of data (Figure 2). You can customize the format and layout of the table, hide columns and set them as non-editable, and also open a form to drill down into a row, displaying all the columns and editing data. Using the form to edit and/or enter data into the table is a much easier method than trying to make changes directly in a very large table, and will greatly improve the user experience.
Figure 2: Form View
Our article on Form View contains a full example.