Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am getting the error "nested aggregation not allowed" for the following Expression:
=sum($(dvQuantity_Pref)*Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand)) *sum( Only({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM))
dvQuantity_Pref = Qtty - 1
dvItem = Item No - xx12542254
(dvItem)* = xx12542254 /1 and xx12542254/2 and............
TotalDemand = 1
T$AMNT_SITM= 4,5
Can you guys please help me to understand the reasons?
Maybe like
=Sum(Aggr(($(dvQuantity_Pref)) * Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand) * only({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM),H_ComponentPath))
You can't just embed a Sum() into another Sum().
You could consider using advanced aggregation (Aggr() function), or maybe just include $(dvQuantity_Pref)
into one of the inner Sum() functions.
To help you more, we need to know the context of this expression.
edit: Same problem with embedding Only() into Sum().
And start with
hi,
Try this,
=sum($(dvQuantity_Pref)* (Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand)) )*
(sum({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM))
thanks...
But the same error message:
As the inner aggregation terms return only a single value, so you do not need the two outer sums. Try this expression:
=($(dvQuantity_Pref)) * Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand) * Only({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM)
If that does not work, you may need to use an Aggr() function, but its hard to day without more information about the context iin which this expressions is being used; and your data model.
A sample qvw with some representative data would help, together with a description of what you are trying to achieve, and with expected results.
This is working :
=Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand)*sum($(dvQuantity_Pref))*
sum({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM)
But the result is incorrect - The Result is over all items
I Need the Result only for
dvItem = Item No ( for example xx12542254 and xx12542254 * .....)
Thank
Thanks
But the Result ist ' - '
I will create a sample qvw with some representative data.........
Attached the sample qvw with some data
Maybe like
=Sum(Aggr(($(dvQuantity_Pref)) * Sum({$<H_ComponentPath={"$(dvItem)*"}>} TotalDemand) * only({$<H_ComponentPath={"$(dvItem)*"}>} T$AMNT_SITM),H_ComponentPath))
Many thx 🙂