Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to calculate order's volume per warehouse in straight table
The dimensions are Date, Time and Order D
In the DB each order contains multiple lines (Products) with different volume and quantity
the calculation that i'm trying to use for WH A :
Sum({<WH={'A'}>}(Quantity*Volume))
but for some reason im getting wrong result
I suspect that the reason is the different volume/quantity in each line
there is a way to calculate it with inner aggr ?
>>but for some reason im getting wrong result
That's not a lot of information to diagnose your problem. There is nothing obviously wrong with your expression, but whether it is right or wrong it depends on your data model.
>>there is a way to calculate it with inner aggr ?
Perhaps, but don't use an aggr if its not required.
Are there a lot of null values in either field? This could be a problem. If either field has a null value, the result is 0 even if the other field is not null.
Your expression might need an aggr like:
sum(aggr(Sum({<WH={'A'}>}(Quantity*Volume)), OrderID, ProductID))
but I think it would be better to calculate Quantity*Volume already within the script.
- Marcus
Thank you, i will try to calculate it in the script instead