Skip to content

Create compare insight

UI · interface

Create a new insight from the Compare section.


The following are the step's expected inputs and outputs and their specific types.

create_compare_insight({"param": value})

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.


title: string

Title of the insight.

columns: array[string]

Columns from which the insight is created.

hiddenColumns: array[string]

Columns that will not be used to create the insight.

sortingOrder: string

Useful to choose the ordering kind of the columns, by difference or by similarity.

Must be one of: "differentFirst", "similarFirst"

replayDisabled: string | boolean = False

Indicates if the insight can replay its original state or not.

Must be one of: "drillDown", "directSelectionInGraph", "nonPersistedColumn", True, False

representation: string

Sets the visualization type. In relative and absolute modes the comparing segments will be rendered as charts, but in tabular mode a table is shown.

Must be one of: "relative", "absolute", "tabular"

elements: array[object]

Type and appearance of an insight's elements. A list in which each item is an object configuring the appearance of a particular insight element.

Items in elements

kind: string

Specify the type of element.


text: string

The text shown for this insight element.

layout: object

The element's position and size. The position refers to the top-left corner of the rectangle representing the insight element, while the size is given by its width and height. For reference, the entire insight is 12 units wide and 9 units high, and the origin (0, 0) of the x/y coordinates is in its top-left corner.

Items in layout

x: integer

Horizontal position of the element's top-left corner. In increments of 1; 0 being the left-most and 8 the right-most position.

Range: -1 ≤ x ≤ 11

y: integer

Vertical position of the element's top-left corner. In increments of 1; 0 being the top-most and 11 the bottom-most position.

Range: 0 ≤ y ≤ 11

w: integer

The width of the element (in increments of 1).

Range: 1 ≤ w ≤ 12

h: integer

The height of the element (in increments of 1).

Range: 1 ≤ h ≤ 9

column: string

Name of the column containing the data to be used in this insight element. Required if the element is of type CHART or STATS.

comparingSegments: array[object]

Array of segments to use in the insight.

Items in comparingSegments

mode: string

Defines some behavior in the UI for this comparing segment.


useInRelevance: boolean

Specify if the comparing segment column was used in the relevance analysis or not.

column: string | null

Main column from which the insight is created.

values: array[number | string]

Selection Values. In categorical and text columns, a selection of single values can be made and this type is useful to do that.

range: array[number | string]

Selection Range. This type is useful for quantitative columns, in which a selection of values in range can be made.