对度量进行分类以用作维度
Categorise measures to use as dimension
我正在尝试构建一个 table,我在其中对多个度量求和并希望将它们分类到维度中。
为了简化,我在仓库中有一个 table 具有以下架构:
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 功能,但没有运气。
我知道我可以显示为度量值,但是我还将为年初至今的费用做一个专栏,并希望通过一个月的一栏和细目分类来保持仪表板其他区域的一致性一个维度。
为了参考起见,我用 Value List 完成了这个问题。我在 table 中添加了以下内容作为显示类别的维度:
=valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')
然后我将其添加到我的度量中,以正确地对每个维度的值求和。
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Direct Variable Expenses',
sum({<product_type={'Sales'}>} existing_direct_variable_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Direct Fixed Expenses',
sum({<product_type={'Sales'}>} existing_direct_fixed_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Indirect Expenses',
sum({<product_type={'Sales'}>} existing_indirect_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='New Direct Variable Expenses',
sum({<product_type={'Sales'}>} new_direct_variable_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='New Direct Fixed Expenses',
sum({<product_htype={'Sales'}>} new_direct_fixed_expenses))))))
我正在尝试构建一个 table,我在其中对多个度量求和并希望将它们分类到维度中。
为了简化,我在仓库中有一个 table 具有以下架构:
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 功能,但没有运气。
我知道我可以显示为度量值,但是我还将为年初至今的费用做一个专栏,并希望通过一个月的一栏和细目分类来保持仪表板其他区域的一致性一个维度。
为了参考起见,我用 Value List 完成了这个问题。我在 table 中添加了以下内容作为显示类别的维度:
=valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')
然后我将其添加到我的度量中,以正确地对每个维度的值求和。
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Direct Variable Expenses',
sum({<product_type={'Sales'}>} existing_direct_variable_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Direct Fixed Expenses',
sum({<product_type={'Sales'}>} existing_direct_fixed_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='Existing Indirect Expenses',
sum({<product_type={'Sales'}>} existing_indirect_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='New Direct Variable Expenses',
sum({<product_type={'Sales'}>} new_direct_variable_expenses),
if(valuelist('Existing Direct Variable Expenses', 'Existing Direct Fixed Expenses', 'Existing Indirect Expenses', 'New Direct Variable Expenses', 'New Direct Fixed Expenses')='New Direct Fixed Expenses',
sum({<product_htype={'Sales'}>} new_direct_fixed_expenses))))))