Column Styles
  • 07 Jun 2022
  • 8 Minutes to read
  • Dark
    Light

Column Styles

  • Dark
    Light

Article Summary

Intro

ancoreShare Server allows you to configure condition-based and flexible styling formats for your Sense table object. You can specify colors, font styles and alignment for each column in the table and set conditions or Qlik Expressions to further define styles for specific cells.

QlikView
Table elements from QlikView sources maintain all formatting settings for appearance, as well as the number formatting, when exporting them. Therefore the Column Styles editor is not enabled for QlikView tables, as you can set all the styles directly in the QlikView object of your source.

image-1648387914445


Order of settings
  • The style settings in the column style editor override the General table settings specified in the settings bar.
  • Styles within the column style editor are respected in order of precedence from top to bottom - last one rules.
  • Checkboxes allow to NOT set a style and therefore preserve from the preceding settings.

For example, In style 1 if you have specified all sales totals under 5 Million should be filled with Red. After that, if you add a style 2 with the condition stating sales totals column should be filled in Green, then the table will respect style 2, and sales totals cells will be filled in Green even if the totals are less than 5 Million.
However, if you uncheck the checkbox corresponding to the fill color, then the totals cells will be filled in Red.

Now, let's see how you can work with column styling.


The following sections will explain:


Add Column Style

To access the editor and specify conditions that will govern the table headers, totals rows, or columns, click the Set Column Styles button in Table Settings.

  1. To add a new style, click the Add button from the bottom left of the dialog box. The fields on the dialog box are activated.
  2. Drag and drop the style in the Styles pane on the left to change their order.
  3. In the Title field, provide a name for the style that will help you identify it.


Column Definition

Specify to wich column(s) the added style should be applied. You can either go by column name for one column, or by column number for one or more columns.
This section also allows you to set a specific width for the specified columns.

Column Name

Provide the column name on which you want to apply the style. Alternatively, start the name with "=" to provide a Qlik expression. This enables you to also work with dynamic dimensions or to control the column for which you create this style for example with a Qlik Variable input object.

The columns names are the same as those in your Qlik App. If you provide a column name, the other fields for column numbers mentioned below are hidden, as you are defining the style for this particular column.

If Load Metadata was executed in the source of this object, a list of available column names will be suggested.

Refer to the Qlik documentation to know more about expressions.

Column Numbers
  • Column Start:
    Number value, at which the style begins in the table.
  • Column End (optionally):
    Number value, with which the style ends in the table. If left blank, all the columns till the end of the table, will follow the style.

See example on the right showing column numbers.

  • For every (optionally):
    Choose the repetition that should follow the style, such as every column, or just every second column, third column, and so on. 
  • Header rows (optionally): 
    Here specify a comma-separated list of one or more header row numbers, on which the style will be applied. If left blank, all the header rows will follow the style.
Column Width
Use this field to specify the column width. By default, the width is set to Autosize.
If specified, the number is calculated in the Report Unit set in the Report Settings (default is mm).

Header Style

To define a style for headers, toggle to enable the Show Header Style option, and specify:

  • Font and Fill Color: Use the color picker to select the font and fill colors for data in the header, or provide the color in HEX code.
  • Alignment: Select the horizontal and vertical alignment of the header content.
  • Font Style: Choose formats like bold or italic.


Body style

To define a style for table cells, toggle to enable the Show Body Style option.
The Column/Row Body Style area allows you to further target the style to certain rows or even specific cells, based on conditional values or a Qlik expression.

Specify rows
  • Valid For:
    Choose whether you want to apply the condition on All Values, Total Values, or Non Total Values.
  • Condition: 
    Select the kind of condition from the list.
    The characters apply to numeric values - e.g. "!=" (is not), or ">=" (greater as or equal).
    The names apply to text values - e.g. "Begins with", or "Contains".
  • Condition Value or Expression:
    Specify a value or expression for fulfilling the condition. The style will be applied to the cells that meet this condition. You can specify the condition as a Qlik Expression too.
    Refer to the Qlik documentation to know more about expressions.
  • Rows:
    You can choose which rows will follow the condition. You can select All, Even (2nd, 4th, 6th, and so on), or Odd (1st, 3rd, 5th, and so on) rows. 
Set style
  • Font and Fill Color: Use the color picker to select the font and fill colors for data in the header, or provide the color in HEX code.
  • Alignment: Select the horizontal and vertical alignment of the header content.
    The body styling area has an auto-align option (the magic wand icon), which aligns text to the left and numeric values to the right.
  • Font Style: Choose formats like bold or italic.
Apply Styles To: Choose whether to apply the style only to the cells in the specified column(s) or to continue the style for the row to the right.
  • Columns: The style will be applied just to the column(s) that are specified in the Column Definition.
  • Row: The style will be applied to the cells in the specified column(s) and the entire row to the right of those cells where the condition applies.
Tipp
In case you have configured multiple styles, you can clear the checkbox corresponding to the properties that you want to be respected in the preceding styles.

For example: If you want only the body fill color to be changed for a specific condition while keeping the rest of the properties the same as the previous style. Add a new style, select only the checkbox corresponding to the fill color and specify the color. The new style will respect all other properties defined in the previous& style, but with the new fill color.

Once your are done with setting your styles, click Apply.


Example

Let us look at an example for styling headers and columns to understand how it works.
Consider a Sales report, where you want to highlight whether the sales target was achieved or not.

For this, let us assume that the sales target was $50 Billion.
Now, we can define two conditions. One for those who achieved the target, and another for those who did not. You can define just one condition too, and the rest of the cells will follow the default styling.

Step 1 - Set the first style:

Let us first define a condition for the cells that meet the target.
Here, we can set the condition as Total Values >= 50000000000 and define a color scheme corresponding to it.
As you can see in the image, we have specified the fill color for all such columns as Green.


Step 2 - Set the second style:

Let us now define a condition for the cells that do not meet the target.

Click the Add button to add another condition.
Here, we can set the condition as Total Values < 50000000000 and define a color scheme corresponding to it.
As you can see in the image, we have specified the fill color for all such columns Red. Note that the checkboxes corresponding to all the other styles are not selected, as we want to inherit the styles defined in the preceding column style.


Result:

Here's a sample report showing how the conditions are applied to different column cells. As you can see, all the cells where totals exceed $5 Billion are highlighted in Green, and the ones having less than $5 Billion are highlighted in Red.


Similarly, you can define any style for your table.

Note
The order of adding styles is very important as the styles are respected in order of precedence.

Column Content Settings

This setting is mainly here for historic reasons, before the Column Style editor was added and ancoreSoft products are always developed very thoroughly with consideration of existing installations and downwards compatibility. Therefore the Width and Num setting targets the same property as Width and Alignment in the Column Styles editor.

However, the Wrap setting is only available here. Therefore it is recommended to leave the Width empty and Num to Auto, and use the Column Styles editor instead to prevent the same properties from being overwritten unintentionally and getting confused.

Important
The settings defined here, override the width and alignment setting defined in the Column Styles editor

To specify column styles using the settings here, click a blank space under Col and provide the name of the column for which you want to define the width. The settings will work only if you provide a valid column name. The columns names are the same as those in your Qlik App.

Then specify the following:

  • Width: Provide the width of the column. Remember that the sum of widths for all columns must not exceed the width defined in the Size of the table element itself.
    NOTE: This overrides the Width setting in the Column Style editor.
  • Num: Specify if the column content is to be considered as a number or a text string. This impacts the content alignment inside the table cells, as the numbers are right-aligned, and the text is left-aligned.
    NOTE: This overrides the Alignment settings in Column Style editor.
    • Yes: Content will be right-aligned.
    • No: Content will be left-aligned.
    • Auto: Select this option to let ancoreShare detect the content type automatically. For example, years are treated like numbers.
  • Wrap: Specify whether to wrap text inside the table cells or not. By default, the content of table cells does not wrap and clips whole words or complete numbers if the column width is too small. To allow wrapping for showing the whole content, select the Yes option here.

Important
We recommend using the Column Styles editor for specifying Width and Alignment.





Next Steps:




Was this article helpful?

What's Next