By Agro-Soft Ltd on 26.05.2023
If you have ever tried to implement a recursive data from inside the DAX just like how you will do they back into the nice days of the past out of MDX (look for here) you’d came with good DAX algorithm similar on the you to below:
grams. X = X + 1 can’t be outlined of a mathematical point of view (at the very least predicated on my personal limited mathematics experience). MDX was somehow unique right here where in actuality the SSAS engine requires worry of this recursion by using new In the event the() under consideration.
Where might you you can easily you desire a beneficial recursive formula in this way? In my example I could do a bit of very basic predicting depending to the month-to-month growth pricing. I have a dining table with my real sales and one desk for my requested monthly development while the percent. Easily don’t possess one real sales I want to use my expected monthly development to assess my personal prediction you start with my personal last real sales:
This is exactly a very common significance of financing software, the is very easy to attain in pure Do just fine however, really even in the event to accomplish in DAX as you most likely knew on the very own exactly what in the long run contributed your here
Inside the Do just fine we could possibly just add a computation like this and you will propagate they down to most of the rows: (if in case column C includes your sales, D your own Prepared Rate of growth and you can Meters is the column where the algorithm alone life)
To resolve that it into the DAX we should instead totally rewrite the computation! The general method we are likely to play with has already been told me because of the Mosha Pasumansky certain in years past, however for MDX. Thus i accompanied new reason and altered they correctly so you can in addition to manage DAX. We split up down the solution toward several procedures:1) select the past real conversion process – with a worth of 352) discover in which worthy of we need to multiply the previous days really worth to find the newest month’s Forecast3) determine brand new natural logarithm (DAX LN()-function) of your own worthy of when you look at the 2)4) Sum every opinions right from the start of your energy through to the latest month5) Boost all of our share-worth regarding step four) to your energy from [e] having fun with DAX EXP()-function6) do some beauty products and you will monitor all of our the brand new worth in the event the not any transformation can be found and take proper care of aggregation into highest account
Note: The fresh Workplace 2016 Examine introduces one or two the newest DAX qualities, as well as PRODUCTX() used to mix the fresh new Strategies 3) to help you 5) into the one easy formula without the need for any cutting-edge LN() and you may EXP() combos.
In this case, i use the most recent [Sales]-value as our very own [Past Transformation], if not i explore a predetermined worth of 1 once the a beneficial multiplication that have step 1 does not have any affect the final influence.
Whenever we lack one [Last Conversion], we play with the [Planned GrowthRate] to for the later multiplication/summary, or even simply take the [Past Sales]-well worth.
Step 3 and you may 4: While we don’t explore “Multiply” since our very own aggregation we first need calculate the fresh LN and you can conclude on earliest week to the current day:
Observe that we need to explore SUMX over all of our Weeks here to will also get best subtotals into highest account, e.g. Ages.
The newest calculation is actually flexible enough to deal with destroyed conversion process. Anytime including we possibly may only have transformation getting January, our very own recursion create start there and use the brand new [Arranged GrowthRate] currently to help you assess the new February Anticipate-value:
Пн | Вт | Ср | Чт | Пт | Сб | Вс |
---|---|---|---|---|---|---|
« Авг | ||||||
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Основываясь на европейском 40 летнем опыте внедрения информатизации аграрных предприятий, мы предлагаем концепцию комплексного внедрения технологий точного земледелия. Собирая в единое целое технологии, технику, инновации мы заставляем их работать в единой системе.
Мы находимся в самой гуще сельскохозяйственной жизни, отсюда получаем всю необходимую информацию для оптимизации наших программ, и здесь, в производственной практике находим в конечном итоге наших клиентов.
355003, г. Ставрополь, ул. Краснофлотская, 66
350000, г. Краснодар, ул. Трудовой Славы, 25
352193, Краснодарский край. г. Гулькевичи ул. Крестьянская, 1
agro-soft@afro-soft.ru
Phone 8(865)246-45-61
Fax 8(861)603-25-53
© 2017, Агро-Софт