Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have DATA table: ORDER with corresponding STATUS. Status is DUAL.
If the last status per order is not equal "order-delivered", than the ORDER is in progress. The maximum status for this order is considered status in progress
I want to know how many statuses in progress I have (in other words, for all my undelivered orders I want to know of which stage they are in at the moment). I have Date dimension, but i will disregard it for simplicity.
I managed to build aggregation table:
| aggr( |
| {< |
| OrderN= |
| P({<status={"order-created"}>})- |
| P({<status={"order-delivered"}>}) |
| >} |
| max(status),OrderN) |
But I can't figure out how to build the table, 'what i need'
I need it in this exact way as in screenshot (with one Dimension = status, and one Measure).
Is it possible?
Thank you

Max,
When I select Status dimension, the whole adjusted formula above( your's formula ) collapses.
Any idea why this is happening?
Думаю да, я в курсе. В выражении в set analisys нужно добавить status=,
sum(
Aggr(
If(status = Max({< status=, ................... ) >} TOTAL <OrderN> status) , 1, 0)
, OrderN, status)
)
чтобы выборка по status не влияла на определение максимального значения
Можно было бы сделать так
sum({< сюда выносим весь остальной set analisys >}
Aggr(
If(status = Max({1} TOTAL <OrderN> status) , 1, 0)
, OrderN, status)
)
, но тогда максимальный статус перестанет реагировать на любые выборки, в том числе и на период. Что может не совсем отвечать требованиям, если, скажем, нужно посмотреть на состояние в прошлом, отфильтровать заказы или еще что-то. Тогда добавим туда Дата = p(Дата) или Дата = $::Дата (почти то же самое), и по любой выборке по необходимости
sum({< сюда выносим весь остальной set analisys >}
Aggr(
If(status = Max({1< Дата = p(Дата) >} TOTAL <OrderN> status) , 1, 0)
, OrderN, status)
)
Я не знаю всей модели данных, но вариантов несколько и нужно выбрать наиболее подходящий.
Max,
I ended up with the following:

IF in this example sorts out only those records which are equal to the selection in Status.
It is sort of compensation for the {<status=>} I had to put in set analysis in order to build the table contating all data, on which I susbequently aplied above()
That's what I finally have built:


Спасибо за помощь, я 4 дня мучился ))
You are welcome)) ![]()