标记Turkenburg
社区Boss

Calculation Waves

大家好,

I'm hoping to find further information regarding Calculation Waves in regards to best model performance & best practice

我有一些模型,因此性能不是最佳的,我认为这可能部分是由于过量的计算波。是否有关于波浪对性能的影响的信息?

例如,当您跨多个模块分期数据时,有一个额外的模块可以进行数据的影响?

谢谢

标记

1 ACCEPTED SOLUTION

Accepted Solutions
大卫Smith
社区Boss

Echoing the above, in terms of building models, it is best to model formula in the most logical way

以一个简单的例子:

收入=价格 *销量

COGS = Cost Price * Sales Volume

利润=收入 - 齿轮

保证金%=利润 /收入 *100

So there are 3 "waves" to the calculation

2020-08-17_12-36-52.png

查看公式并遵循最佳实践将公式分为单独的订单项时,这是合乎逻辑的

但是,在某些情况下,其中一个订单项可能会导致阻塞并防止下游计算 - 这些情况通常可以是当组合公式的许多元素时,尤其是将公式作为其他函数中的参数。

We are able to trace these blockages in our lab, so if you think there is a specific problem, contact your Business Partner who can help arrange this

So, taking the example above, if we needed to, we could re-engineer the formula as follows to reduce the number of waves:

2020-08-17_12-36-52.png

这可能会减少计算时间并取消依赖性,但是,并不总是清楚的,因此,正如外部所述,我不建议在构建公式时试图先抢购这一点。@markturkenburgdon't over think it. The engine is complex and it will split tasks and utilise the processing power in the most efficient way. The Planual is written to try and work with the engine as much as possible not against, so using best practice should, in the most part, lead to good performance.

I hope this helps

大卫

View solution in original post

11个答复11
Jareddolich
Moderator

@markturkenburg

You ask some of the best questions. By calculation waves I assume you're referring to the D.A.G. or the Directed Acyclic Graph (aka the Hyperblock).@DavidSmithgives us a glimpse into this engine in his关于稀疏性的真相, start with Myth#2. This, to me, has been a bit of a controversy because I feel calculation optimization conflicts with the PLANS methodology at times. You have the ability to use D.A.G. multi-processing but you have write your formulas so they aren't dependent on each other.

例如:

  • Formula 1: C = A + B
  • Formula 2: D = C + E
  • 方程式3:d = a + b + e

在这种情况下,公式2被序列化。“ C”必须在“ D”之前计算计算。但是,方程式3可以与一级方程式1同时计算,因为它不依赖。

So by calculation waves, I believe it comes down to the D.A.G. calculating the dependencies and working through the calculations. Try reading@DavidSmith稀疏文章。希望这会有所帮助。除此之外,我们必须让David或其他专业人士之一跳入。


Jared Dolich
标记Turkenburg
社区Boss

谢谢@JaredDolich

是的,这是一个有趣的人,我可能对此太深刻了,但我记得在2020年CPX中,有关于最佳实践的会议,他们简要谈到了计算波和性能的影响

我想我正在尝试增加对超块/最佳实践的理解,以确定在构建模型时我是否应该重点关注波,或者是否函数/公式组成,避免文本/使用布尔值等和尺寸一致性(参考模块使用该模块同样的维度)对性能更具影响力

谢谢

Jareddolich
Moderator

@markturkenburg

Yeah, I think you'll get no disagreement that Booleans are the way to go. Using system modules, where you do your calculations once and refer to them ongoing is also a HUGE performance boost. Nested IF statements should be broken up and if possible, always have the most likely outcome of the IF statement first so Anaplan can exit the formula as soon as possible.

To that end, the staging modules you refer to, double check that you don't have anything calculating on multiple dimensions that can be calculated on few dimensions.

Lastly, I've only read this, so I don't know if this really helps or not but it sounds like the indexing of the dimensions is based on the order in the "applies to" column. Make sure the modules use the dimensions in the same order in the applies to column. So if you have PRODUCT, LOCATION in one module and LOCATION, PRODUCT in another, try to get them to line up the same. You will have to manually type them in the applies to column to get them to line up though (I learned this the hard way).

Anyway, just some ramblings of things you probably already know. Hopefully, we can get some of the Hyperblock Pros to weigh in.


Jared Dolich
标记Turkenburg
社区Boss

同意所有这些@JaredDolich

I guess I'm trying to determine if all of those standard best practice items that you mention have the same impact of reducing calculation waves

我也在闲逛,但只是把想法扔出去:beaming_face_with_smiling_eyes:

标记

Misbah
Moderator

@markturkenburg

Glad that you are asking uncomfortable questions:grinning_face:

这是一个非常广泛的问题,需要通过多个步骤回答。大多数事情@JaredDolichhas already covered. But let’s understand it wrt the performance of the model. Here is the article by@Griffinkwhich I call as Pure Gold. Just go through it, you will get to know loads of things.

https://community.anaplan.com/t5/Blog/Lionpoint-Group-Enhanced-Anaplan-Model-Performance/ba-p/63465

Feel free to post any further questions.

Note: Go Slow while reading thru the article.

标记Turkenburg
社区Boss

谢谢@Misbah!

有趣,但是这个会议@Griffinkwas exactly what I was referring to in my original post. I was in the audience for the session & remember being super impressed but it was also the 1st place I encountered the 'Waves' concept

I'll work through it:thumbs_up:

标记

nathan_rudman
社区Boss

我认为您用作计算波的术语是贾里德(Jared)将其称为打开模型的算法。

In which case yes the "order" and references has a lot of importance, as stated in the planual rule don't daisy chain.

Recently I worked on optimizing a model with 12K+ line items and the impact of small calculations can be important in the end depending where they are in the calculation chain.


Nathan Rudman, Anaplan Model Builder
标记Turkenburg
社区Boss

12K订单项目!@nathan_rudman:face_with_head_bandage:

实际上,我是指模型的性能,例如四处走动,打开模块等的速度,而不是初始开口

大卫Smith
社区Boss

Echoing the above, in terms of building models, it is best to model formula in the most logical way

以一个简单的例子:

收入=价格 *销量

COGS = Cost Price * Sales Volume

利润=收入 - 齿轮

保证金%=利润 /收入 *100

So there are 3 "waves" to the calculation

2020-08-17_12-36-52.png

查看公式并遵循最佳实践将公式分为单独的订单项时,这是合乎逻辑的

但是,在某些情况下,其中一个订单项可能会导致阻塞并防止下游计算 - 这些情况通常可以是当组合公式的许多元素时,尤其是将公式作为其他函数中的参数。

We are able to trace these blockages in our lab, so if you think there is a specific problem, contact your Business Partner who can help arrange this

So, taking the example above, if we needed to, we could re-engineer the formula as follows to reduce the number of waves:

2020-08-17_12-36-52.png

这可能会减少计算时间并取消依赖性,但是,并不总是清楚的,因此,正如外部所述,我不建议在构建公式时试图先抢购这一点。@markturkenburgdon't over think it. The engine is complex and it will split tasks and utilise the processing power in the most efficient way. The Planual is written to try and work with the engine as much as possible not against, so using best practice should, in the most part, lead to good performance.

I hope this helps

大卫