Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to give the end user the possibility to filter on an expression:
if(OrderStatus='Makulerad',0, If ((sum(confirmed_quantity) < sum(ordered_quantity)), (sum(confirmed_quantity) - sum(delivered_quantity)), (sum(ordered_quantity) - sum(delivered_quantity))))
They want to be able to filter on everything over 0, everything under 0 and 0 which works when using smart search >0, <0, 0 and so on.
I've tried putting this in an calculated dimension with aggr and that sort of works but I need to aggr over a lot of dimensions so it's not a good solution.
I've also tried aggregation in the script outside the fact table and then join the results to the fact table on OrderId.
But I get an error:
Any ideas?
SumOverUnder:
Load [Supplier Order ID],
if(OrderStatus='Makulerad',0,
If ((sum(confirmed_quantity) < sum(ordered_quantity)), (sum(confirmed_quantity) - sum(delivered_quantity)), (sum(ordered_quantity) - sum(delivered_quantity)))) as OverUnderDelSum
Resident Facts group by [Supplier Order ID];
or
SumOverUnder:
load [Supplier Order ID],
if(OrderStatus='Makulerad',0,
If (cq < oq, cq - dq,oq- dq) as OverUnderDelSum
;
Load [Supplier Order ID],
sum(confirmed_quantity) as cq,
sum(ordered_quantity) as oq,
sum(delivered_quantity) as dq
Resident Facts group by [Supplier Order ID];