Line item subsets are one of the most powerful and efficient features in Anaplan, yet one of the least understood. The COLLECT() function is probably the only “black box” function within Anaplan as is it not immediately apparent what it is doing or where the source values are coming from. In the following article, I will cover how to understand line item subsets more easily, and also explain their many uses, some of which do not need COLLECT() at all.
For more information on creating line item subsets see行项目子集in Anapedia.
行项目子集是从一个或多个模块中从一个或多个订单项中绘制的项目列表。简而言之,它将行项目转换为可以执行计算的列表。有一些限制:
行项目子集可用于许多不同的功能领域。对于使用的示例,我将它们基于新的1级培训的最终模型。下载模型并按照说明在相同的结构上进行练习。
These examples are deliberately simplified, but I hope you find these insightful and easy to transfer into your models to simplify the formulae and provide more flexibility to your users.
Table of Contents:
This is the classic use of line item subsets. A source module contains line items, and subsequently, you need to perform additional calculations on these line items. While in some cases this can be managed through complex formulae, normally these workarounds break most of the best practice guidelines and should be avoided.
Use Case example:
The source module contains forecast data with line items for the profit and loss lines in U.S. dollars. We need to convert these values into local currency based on the Country dimension.
The source modules are as follows:
The first step is to create the line item subset, and for this report, we only want summary values.
现在已经创建了行项目子集,可以在模块中使用。
请注意,这些值与REP03中的值相同,现在以列表格式(无格式)显示了行项目。另请注意,这些值来自预测版本,因为目标模块没有版本,因此当前版本被用作源。
行项目应该注意汇率t as a Subsidiary view (excluding the line item subset from the applies to) because we are showing it on the report for clarity. If this display was not required, the calculation could be combined with the Local Currency formula.
You can also use a line item subset to help with the transformation between source and target modules.
Use Case example:
We want to summarize costs (from the reporting P&L) into Central and Locally controlled costs.
我们使用总和公式是因为源维数和映射维度相同。所以,“If the source is the same, it’s a SUM.”
行项目子集可以包含来自多个模块的订单项。虽然有一个警告。所有模块必须至少共享一个通用维度/层次结构和/或具有用于非匹配维度的顶级设置。
Use case example:
Based on user-entered settings, we want to compare the values from two time periods for metrics from three different modules and calculate the absolute and % variances.
源模块都共享一个共同的维度:
注意:G3位置作为父母的G2国家
The module for the user parameters is:
And the metrics required are:
We could solve this problem without using a line item subset:
第1个月的公式是:
I won’t repeat the formula for Month 2, as it is effectively the same, just referencing the Month 2 line item in the source.
You can see, that even for a small set of metrics, this is a large complex formula, going against best practices. So, let’s not do that.
Note, this time we are using LOOKUP rather than SUM because the source dimension doesn’t match the dimension of the mapping module.
我认为您会同意该公式更容易阅读,并且更有效。
However, we can do even better; but note that there now are two ‘lookups’ in the formula. The more “transformations” there are in the formulae, the more work the engine needs to do. We can remove one of these by changing the target module dimensionality.
Note, only one lookup is needed in the formula.
Another use case that line item subsets can be used for is filtering. And this functionality has nothing to do with staging data or mapping modules. It is possible to filter line items and these can also be filtered based on other dimensions too.
Use Case example:
Based on user-entered settings, for the reporting module (REP03) we want to show different line items for each year and version.
We already have set up the Years to Versions filter module
We now want to set up the user-driven parameters. To ensure that the users’ settings do not affect each other, we need to use the system generated Users’ list.
Note that Employee expenses and Other Costs are not available to check. This is because, in REP03, they are a simple aggregation and are shown as Parents of the other line items.
那么,我们如何解决这个问题?您可以通过关闭这些设置来“欺骗”模型。
The subtotals are now available to check in the filter module.
It is worth noting,be carefulwhen doing this. If you are using the line item subsets as a dimension in adata entrymodule, thetotals will not calculate correctly.有关更多细节,请参见最终想法。
To set up the filter
The module will now filter line items and years when the version page selector is changed.
Note the subtotals work correctly in this module because it is not data entry.
Line item subsets can be used in conjunction with Dynamic Cell Access to provide very fine-grained control over data; again, without any mapping modules or COLLECT() statements
用例示例:
In the following module
The following rules apply:
设置访问:
The module now looks like this:
我一开始提到,使用订单项子集时,您可能会失去格式化。但是,在某些情况下,可以继续格式化以及计算
用例示例:
Using the values from REP03, we want to classify Sales and Costs and then calculate a cost % to Sales. Yes, we could do this in the module itself as a separate line item, but we also want to be able to reclassify the source line items from a dashboard using mappings rather than change the blueprint formula. We also want to maintain formatting.
For this example, I have just changed the styles to illustrate the point
注意格式保留。
最后,我想提一下的功能,该功能尚不为人所知,但非常强大。版本公式。将订单项子集与版本结合使用,版本公式扩展了“公式范围”功能。可以使用公式范围来控制公式,但是选项有限。
Use Case example:
假设我们在一个模块中拥有实际数据,另一个模块中的预算数据,我们希望使预测能够写入。当前版本(在版本设置中)设置为预测
For this example, there is only one line item in the target module, but this functionality allows the flexibility to set different rules per version for each line item
Note that now at the top, you can see that there is a Version Formula set.
我们提到了汇总行为和“摘要”设置。让我向您展示这和公式的构建如何影响订单项子集的行为
We will use the following module as an example. This module is only used to set up the line item subset, so no dimensions are needed.
Note that the subtotal formulae are simple aggregations.
This means the subtotal lines:
The following module is dimensioned by the line item subset to highlight 1. and 2. above.
如果我们决定不希望员工在行项目子集中的费用,则会发生两件事:
为了减轻后者remedie有两个点s.
Note the 'Parent' and 'Is Summary' settings, the Costs subtotal now calculates correctly.
If we change the formulae to be something other than simple addition, you will see that calculation is fine in the source module,
但不在“行”子集模块中。
Why is this?
Remember the 'Is Summary' setting we changed in the Filters section when we adjusted the formula the 'Is Summary' is now unchecked
This means that the line item subset doesn’t treat the line as a calculation, hence the data entry 0 shown instead.
If your costs need to be positive (as in this example), it is possible to calculate correctly using a ratio formula. This works for normal line items/lists as well as line item subsets. SeeChanging the sign for Aggregationfor more details
Thanks for another great article,@davidsmith呢订单项子集绝对非常强大且用途广泛(并且被低估了!)
我发现LI非常有用的另一种情况是,计算逻辑需要在列表成员中变化时,尤其是当最终用户需要控制使用哪种选项时。例如如果我有几种预测方法的选项,我可以将其设置为LIS,并使用LIS-Formatting系列项,以允许用户选择适当的产品以将其应用于特定产品,客户,区域等。最终数字像往常一样容易。
Thank you@davidsmith呢
I've used LIS for Calculations on Calculations, Multiple Modules and Transformations and now I can consider them when thinking all of these other items. I particularly like the ideas for DCA and Version Formula.
Hi,
Do I need to create a separate "Currency" list for module "DATA02 Exchange Rates'.Rate"? If no, then what should be the list members for module "DATA02 Exchange Rates'.Rate"?
Thanks
Yes - DAT02 is dimensioned by the currency code, and the line item in SYS03 is also formatted by that list
that then allows the formula'DATA02 Exchange Rates'.Rate[LOOKUP: 'SYS03 Country Details'.Currency Code]
希望有帮助
David
Is there a restriction that input line items cannot be added into LISS?