如何在 KDB Q 中按日期对列求和?
How can I sum a column by date in KDB Q?
我在 KDB 中有一个 table,其中包含日期、时间和 returns 列。我需要将每天累积的 returns 存储在一个新列中,但我不确定如何按日期分隔求和函数。这是我试过的:
Table: update cumreturns: sums returns from Table by date where time within (09:30:00;16:00:00)
但是我得到一个评估错误:我 运行 它的日期。是我的语法不对还是我需要另一种方法来解决这个问题?
你需要在 'from' 语句之前包含 by 子句,像这样
update cumReturns:sums returns by date from t
我在 KDB 中有一个 table,其中包含日期、时间和 returns 列。我需要将每天累积的 returns 存储在一个新列中,但我不确定如何按日期分隔求和函数。这是我试过的:
Table: update cumreturns: sums returns from Table by date where time within (09:30:00;16:00:00)
但是我得到一个评估错误:我 运行 它的日期。是我的语法不对还是我需要另一种方法来解决这个问题?
你需要在 'from' 语句之前包含 by 子句,像这样
update cumReturns:sums returns by date from t