按索引列你好!
按索引引用列的正确方法是什么? 理想情况下,我正在寻找这样的东西:

先感谢您!
消费者和市场研究回复:按索引列谢谢布雷迪,这正是我一直在寻找的。 多谢!
回复:按索引列啊... 我现在明白你想要什么了。
尝试将此作为您的公式。 它使用格式“column(dt, n)[row()]”来获取数据表第 n 列的当前行中的值,其中 n 的值是您在数据表的当前行中放置的任何值。 :块列。
Column( :Block << get data table, :Block )[Row()]
干杯,
布雷迪
回复:按索引列不确定您想从列中获取什么数据。 块列是否定义了要从中获取数据的单元格的列和行?
Column(:Block)[:Block]

回复:按索引列谢谢jthi,我觉得“<< get name”让我们向前迈出了一步。 我的最终目标是基本上进行 HLOOKUP,这是一个演示。 目前它提取列名称,而我希望它查看该列的数据。

如果需要的话,这是完整的代码:
New Table( "Untitled",
Add Rows( 3 ),
Compress File When Saved( 1 ),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [11, 111, 1111] )),
New Column( "Column 2",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [22, 222, 2222] )),
New Column( "Column 3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [33, 333, 3333] )
),
New Column( "Block",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3] )
),
New Column( "Formula",
Character,
"Nominal",
Formula(
Choose( :Block,
Column( 1 ) << get name,
Column( 2 ) << get name,
Column( 3 ) << get name))))
回复:按索引列尝试使用 << get name 而不是 Column Name()
Choose(:Block,
Column(1) << get name,
Column(2) << get name,
Column(3) << get name
)

完整示例:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
Compress File When Saved(1),
New Column("Block", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3])),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([1, ., .])),
New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([2, ., .])),
New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([3, ., .])),
New Column("Formula",
Character,
"Nominal",
Formula(Choose(:Block, Column(1) << get name, Column(2) << get name, Column(3) << get name))
)
);回复:按索引列对于脚本来说可能是这样,但在公式中我收到此错误:

有趣的是,弹出窗口建议可以提供号码,但事实似乎并非如此

回复:按索引列您应该能够仅使用列(索引)。
向数据列对象发送消息
col = Column( 2 ); // assign a reference to the second column