計算上下文是DAX的核心機制,在DAX圣經中對計算上下文的講解可謂層層展開,不斷深入,深入到每個階段都重新更新定義,或者說是更準確的定義。猶如從傳統力學到牛頓力學再到相對論,層層展開。
如何學習和掌握計算上文
Evaluation contexts are hard to fully understand. They not only require you to
learn some new concepts, they really require you to alter what you know when
writing code. This is, in our experience, the hard part of DAX: changing the
way you think and start thinking in DAX.
完全理解計算上下文是不容易的。不僅要求學習很多新的概念,更在于改變對寫公式時的認知。也就是說,在我們的經驗看來,DAX最難的就在于:改變思維方式并按DAX執行方式思考問題。
If you found the whole chapter a tough one, and you had to read it again and
again, that is very normal; you are in good company. This company includes us,
the authors. We started learning DAX in 2010 and we are writing this book in
- Unbelievably, it took us five years to master the code of DAX and of the
engine, with a lot of discussions and meetings with the development team in the
meantime.
如果你發現學習本章很難,甚至讀了好幾遍,這是很正常的。您現在學習DAX比我們那時要好多了,其實你正處于一個很好的環境,這里有我們(作者)。當年我們開始學的時候是在2010年,而這本書寫于2015年。不可想象吧,學習DAX竟然花了我們5年時間(掌握DAX以及理解DAX引擎工作原理),在期間我們和DAX研發團隊有著大量的討論和交流。
The good news is that these concepts, once fixed in your mind, are unlikely
to go away and be forgotten: They will stay with you and help you come out
from very complex formulas with a smile on your face—the smile of someone
who knows that he or she really understands what is happening under the
cover.
好消息是:一旦這些概念深入你的大腦,這也是不容易忘記的,他們將幫助你處理非常復雜的公式。當你因解決某個難題會心一笑的時候,只有你或像你一樣理解DAX的人才能感受在解決問題的表面,處理了多么復雜的問題。
We did our best to explain the internals of evaluation contexts and give you a
clear view of how they work, yet we know that our best is probably not
enough. Our suggestion is to read this chapter multiple times, until you can read
it very fast, because you totally understand it. Doing that is still hard for us,
too.
我們竭盡所能來解釋計算上下文的內部運行機制以便能讓你更清楚它是如何工作的,但我們的努力還是不夠。我們的建議是反復閱讀本章,直到你可以很快地讀,因為那意味著你基本全部都理解了。能做到這些對于我們(作者)也是有挑戰的。