top of page

ETF、共同基金和股票数据:访问分析内容

已更新:8月18日

我在之前的文章中提到过,我尝试 Couchbase 的原因之一是它的内置分析服务。可通过用户界面左侧菜单(位于“搜索”选项下方)进行访问。
ree
除了右侧的窗格外,分析控制台与查询控制台非常相似。您可以在此处链接数据结构,例如来自本地或远程 Couchbase 集群的源。分析服务复制原始数据并允许将其与原始源分开索引。
Couchbase Analytics Views
Couchbase Analytics Views

正如您在左侧看到的,“本地”站点和源之间存在 1:1 的对应关系。该网站允许您将数据分成子组,但我决定从全集开始。


分析视图由 SQL++ 查询组成,类似于关系数据库支持视图的方式。以下是视图定义的示例以及结果集在可扩展列表中的显示方式。


不幸的是,Analytics 服务的索引和数据存储功能不支持数据分区或索引。


它没有为允许分区模拟的索引提供“where”条件。因此,我观察到框系列级别指标的查询执行时间非常长,即使它们仅适用于单个时间段。其他观点也发挥了作用。


Couchbase 尝试通过以下方式解决此问题:


提供多种基金担保

SELECT PeriodEndDate, CIK, SeriesName, ROUND(TONUMBER(aggregateCondition.aggregateInfos.aggregateInfo.amt), 2) AS Amount, ROUND(TONUMBER(aggregateCondition.aggregateInfos.aggregateInfo.collatrl), 2) AS Collateral_Amount, aggregateCondition.aggregateInfos.aggregateInfo.invstCat AS Investment_Category, ROUND(TONUMBER(aggregateCondition.aggregateInfos.aggregateInfo.amt) - TONUMBER(aggregateCondition.aggregateInfos.aggregateInfo.collatrl),2) AS Collateral_Gap FROM FundParents WHERE aggregateCondition.isNonCashCollateral = 'Y'

资金担保成果系列

FundSeriesCollateral for 2023-12-31
FundSeriesCollateral for 2023-12-31

显示现金流

SELECT i.PeriodEndDate, i.SeriesName, ROUND(TONUMBER(i.netAssets), 2) AS netAssets, ROUND(SUM(TONUMBER(i.mon1Flow.sales)+TONUMBER(i.mon1Flow.reinvestment)-TONUMBER(i.mon1Flow.redemption)), 2) AS month1Flows, ROUND(SUM(TONUMBER(i.mon2Flow.sales)+TONUMBER(i.mon2Flow.reinvestment)-TONUMBER(i.mon2Flow.redemption)), 2) AS month2Flows, ROUND(SUM(TONUMBER(i.mon3Flow.sales)+TONUMBER(i.mon3Flow.reinvestment)-TONUMBER(i.mon3Flow.redemption)), 2) AS month3Flows FROM FundParents i GROUP BY i.PeriodEndDate, i.SeriesName, i.netAssets ORDER BY i.PeriodEndDate DESC

现金流结果

MoneyFlows Result Set
MoneyFlows Result Set

3 个月现金流(使用 MoneyFlow)

SELECT PeriodEndDate, SeriesName, ROUND((TONUMBER(month1Flows)+TONUMBER(month2Flows)+TONUMBER(month3Flows)),2) AS net3MoFlows, netAssets FROM MoneyFlows ORDER BY net3MoFlows DESC

过去 3 个月的永久现金流结果

“N/A”没有名字,只有一个地址,而且我没有提供任何补偿。
Results for 3-Month Flows

Couchbase 中的分析图表;以 PNG 格式下载

Analytics Graph over three periods for Fund Trailing 3 Month Flows
Analytics Graph over three periods for Fund Trailing 3 Month Flows

分析服务还包括各种其他产品,例如按时期划分的资产类别、投资工具、按时期划分的总投资等等。虽然它们提供了有价值的信息,但由于查询时间较长而难以使用,因此不适合交互式使用。这些可视化特别适合夜间报告,由于运行时间较长,可能需要在第二天审查数据。


因此,即使服务提供了某些特殊功能,某些分析服务的使用模式可能并不适用于大型数据集(例如大于 100 GB 的数据集)。那些需要即时或按需功能的人应该考虑列式或内存存储等选项来提高数据仓库的可用性。


bottom of page