【发布时间】:2021-06-13 23:16:28
【问题描述】:
我正在尝试构建一个表格,我在其中汇总多个度量并希望将它们分类为维度。
为简化起见,我在仓库中有一张表,其架构如下:
Profitability(month_end_date, product_type, existing_direct_variable_expenses, existing_direct_fixed_expenses, existing_indirect_expenses, new_direct_variable_expenses, new_direct_fixed_expenses)
在我的衡量标准中,我正在对用户过滤的某个特定产品的existing_direct_variable_expenses、existing_direct_fixed_expenses、existing_indirect_expenses、new_direct_variable_expenses、new_direct_fixed_expenses求和。
我想显示下面的输出
费用 |金额
existing_direct_variable_expenses | 1,000
existing_direct_fixed_expenses | 200
existing_indirect_expenses | 1,500
new_direct_variable_expenses | 500
new_direct_fixed_expenses |50
我尝试使用下面的公式对其进行分类,但是它没有超过第一个条件,因为每一行在数据集中的每一列中都有一个值
if(NOT ISNULL(existing_direct_variable_expenses), 'Existing Direct Variable Expenses',
if(NOT ISNULL(existing_direct_fixed_expenses), 'Existing Direct Fixed Expenses',
if(NOT ISNULL(existing_indirect_expenses), 'Existing Indirect Expenses',
if(NOT ISNULL(new_direct_variable_expenses), 'New Direct Variable Expenses',
if(NOT ISNULL(new_direct_fixed_expenses), 'New Direct Fixed Expenses')))))
我也玩过AGGR功能,但没有运气。
我意识到我可以显示为度量值,但是我还将为年初至今的费用制作一列,并希望通过将一列用于一个月并将细分作为维度来保持仪表板其他区域的一致性.
【问题讨论】: