Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for a better solution to the following set analysis:
rangesum(
sum({<
Factory = {0001}
>} [Value1])
*
sum({<
Factory = {0001}
>} [Value2])
,
sum({<
Factory = {0003}
>} [Value1])
*
sum({<
Factory = {0003}
>} [Value2])
//and so on
)
What I'm doing here is calculating different values for each factory and then sum them up with rangesum(). This works fine but isn't a good solution. Every time a new factory is added to the data, I have to add the factory to this set analysis. I have already tried different things with the aggr()-function but nothing worked. Maybe someone of you knows a better solution?
Thank you so much
Regards
Samuel
Not sure but may be like this
Sum(Aggr(Sum(Value1)*Sum(Value2),Factory))
I already tried that but it didn't work. Guess it already sums up all Factory values in the first Sum(Value1)
I tried to follow the expression you shared, in that as wll it sums Value1 and Value2 Separately, If you want to first multiply and then sum, may be like this - Sum(Aggr(Sum(Value1*Value2),Factory))
Pl Share sample data and expected results, I am sure someone should be able to help you by using the samples.