Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following problem
I want to have sum of OrderValue only when orderqty 2013,2014 and orderValue 2013,2014 is <> 0
I try:
if(
Sum({$< Year ={$(PrevYear)} >}OrderedQty) <> 0 and
Sum({$< Year ={$(PrevYear)} >}OrderValue) <> 0 and
sum( {$<Flag_OrderValue = {1}>} OrderedQty) <> 0 and
Sum( {$<Flag_OrderValue = {1}>} OrderValueBase) <> 0,
Sum(OrderValue)
)
Hi,
try
Sum(if(
Sum({$< Year ={$(PrevYear)} >}OrderedQty) <> 0 and
Sum({$< Year ={$(PrevYear)} >}OrderValue) <> 0 and
sum( {$<Flag_OrderValue = {1}>} OrderedQty) <> 0 and
Sum( {$<Flag_OrderValue = {1}>} OrderValueBase) <> 0,
OrderValue )
)
or
use aggr()
like
sum(AGGR(YourExpression,Dimension1,Dim2,Dim3))
Regards
Hi,
can you post sample data?
Regards.
Sample data is presented in the picture above.
Only Total value is incorrect.
Should be 211+1605 = 1816.
In this table a have also 2 dimensions, Supplier and Item
Yes, I see, with a qvw file it is better. Now I try to see what is the problem.
Can you try with:
if(
Sum({$< Year ={$(PrevYear)} >}OrderedQty) <> 0 and
Sum({$< Year ={$(PrevYear)} >}OrderValue) <> 0 and
sum( {$<Flag_OrderValue = {1}>} OrderedQty) <> 0 and
Sum( {$<Flag_OrderValue = {1}>} OrderValueBase) <> 0,
Sum(OrderValue) ,0
)
yes, unfortunately I also tried in this way
Without sample data (I understand the data is sensitive but I mean a load inline with the table) is a guessing game.
Really you cant provvide a test?
Hi,
try
Sum(if(
Sum({$< Year ={$(PrevYear)} >}OrderedQty) <> 0 and
Sum({$< Year ={$(PrevYear)} >}OrderValue) <> 0 and
sum( {$<Flag_OrderValue = {1}>} OrderedQty) <> 0 and
Sum( {$<Flag_OrderValue = {1}>} OrderValueBase) <> 0,
OrderValue )
)
or
use aggr()
like
sum(AGGR(YourExpression,Dimension1,Dim2,Dim3))
Regards
If this is a straight table, change the Total to Sum of Rows on the Expression dialog.
If this is a pivot table, you need an expression like:
Sum(Aggr(If(
Sum({$< Year ={$(PrevYear)} >}OrderedQty) <> 0 and
Sum({$< Year ={$(PrevYear)} >}OrderValue) <> 0 and
sum( {$<Flag_OrderValue = {1}>} OrderedQty) <> 0 and
Sum( {$<Flag_OrderValue = {1}>} OrderValueBase) <> 0,
Sum(OrderValue)
), <dim1>, <dim2>, ....))
Where <dim1>, <dim2>, .... are a comma separated list of the dimensions in your table. Eg
...
), ProductCode, Location))