Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Let's say I have a variable vSales with a big nasty formula.
Why doesn't this work? It seems like it is just calcing the variable and returning a value without regard to the new expression.
=Sum(vSales)
Does it have something to do with where the = sign is placed in the expression and/or the variable formula?
Prueba
=sum($(vSales))
It's probably due to the variable definition. Could you post the exact definition as shown in the variable overview?
sorry, I didn't type out the whole thing... it should be =sum($(vSales))
I'm trying to simplify just to get the underlying reason for why this might happen, so let's just pretend it is something like this:
=sum({<Year={$(=year(today()))}>}Sales)
I found some things about how the variable behaves differently if the leading = sign is in the variable or not, and also something about putting an = sign next to the variable in the expression like this Sum($(=vSales)). So I guess my question is are these things different?
sum({<Year={$(=year(today()))}>}Sales) vs =sum({<Year={$(=year(today()))}>}Sales)
sum($(=vSales)) vs sum($(vSales)) vs =sum($(vSales)) vs =sum($(=vSales))
Right, there are important differences, please see also
http://www.qlikfix.com/2011/06/08/not-all-variables-are-created-equal/
I haven't fully understood if
=sum({<Year={$(=year(today()))}>}Sales)
is your variable definition or
{<Year={$(=year(today()))}>}Sales
or...?
=sum({<Year={$(=year(today()))}>}Sales) is the variable
use
=$(vSales)
sin utilizar el Sum(vSales)
christine.hill schrieb:
=sum({<Year={$(=year(today()))}>}Sales) is the variable
this will evaluate to a number, so whenever you are calling the variable, the result of the sum is returned.
Why are you trying to pass this value to another aggregation like sum() then?
(even if you remove the equal sign from the variable definition, you would try to evaluate a sum() inside a sum(), which is not working without the use of advanced aggregation aggr() function)