Expression table index components

table_index_components.expr

#
# Layout in a table the components of a given *.INDX
#
#---
$index = "IXIC.INDX" # Work with the following index
#---

# Get index name
$name = F($index, "General.Name")

# Get index components
$components = F($index, "Components")

# Map components to [code, name, sector, industry]
$components = MAP($components,
    [INDEX($2, 0, 1) + '.' + INDEX($2, 1, 1), 
     INDEX($2, 2, 1),
     INDEX($2, 3, 1),
     INDEX($2, 4, 1)])

# Load index components table
TABLE($name, $components,
    ['Symbol', $1, 'symbol'],
    ['Name', $2],
    ['Sector', $3],
    ['Industry', $4])

Download