Amazon QuickSight expressions
Amazon QuickSight offers additional expressions to enhance the functionality of Highcharts visuals. Use the following sections to learn more about common QuickSight expressions for highcharts visuals. For more information about JSON expression language in Amazon QuickSight, see the Highcharts Visual QuickStart Guide
Topics
getColumn
Use the getColumn
expressions to return values from specified column indices. For example, the following table shows a list of products alongside their category, and price.
Product name | Category | Price |
---|---|---|
Product A |
Technology |
100 |
Product B |
Retail |
50 |
Product C |
Retail |
75 |
The following getColumn
query generates an array that shows all product names alongside their price.
{ product name: ["getColumn", 0], price: ["getColumn", 2] }
The follwing JSON is returned:
{ product name: ["Product A", "Product B", "Product C"], price: [100, 50, 75] }
You can also pass multiple columns at once to generate an array of arrays, shown in the following example.
Input
{ values: ["getColumn", 0, 2] }
Output
{ values: [["Product A", 100], ["Product B", 50], ["Product C", 75]] }
Similar to getColumn
, the following expressions can be used to return column values from field wells or themes:
-
getColumnFromGroupBy
returns columns from the group by field. The second argument is the index of the column to return. For example,["getColumnFromGroupBy", 0]
returns values of the first field as an array. You can pass multiple indices to get an array of arrays where each element corresponds to the field in the group by field well. -
getColumnFromValue
returns columns from the value field well. You can pass multiple indices to get an array of arrays where each element corresponds to the field in the values field well. -
getColorTheme
returns the current color pallete of a QuickSight theme, shown in the following example.{ "color": ["getColorTheme"] }
formatValue
Use the formatValue
expression to apply QuickSight formatting to your values. For example, the following expression formats the x-axis label with the format value that is specified in the first field of QuickSight field wells.
"xAxis": { "categories": ["getColumn", 0], "labels": { "formatter": ["formatValue", "value", 0] } }