Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I post an expression regarding sum of sales for Current selection and Previous selection of Year..Is that correct expression??
=SUM({<Year = {'>=$(=Max(Year)-1)<=$(=Max(Year)) '}>}Sales)
or
=sum({$<Year={$(=max(Year)),$(=max(Year)-1)}>} Sales)
is not working?
Hi,
You need to use # in dollars expansion when dealing with Numeric varaible (see an extract from QlikView reference manual )
Dollar-Sign Expansion Using a Variable
When using a variable for text replacement in the script or in an expression, the following syntax is used:
$( variablename )
$( variablename) expands to the value in variablename. If variablename does not exist the expansion will
be the empty string.
For numeric variable expansions, the syntax $( variablename ) will generate a number using the regional decimal
separator, i.e. for many countries a decimal comma. Such an expansion should not be used for numbers
inside the script since these must use decimal point. Instead the expansion $(# variablename ) should be
used. (Note the hash sign). It always yields a valid decimal-point representation of the numeric value of variablename,
possibly with exponential notation (for very large/small numbers). If variablename does not exist
or does not contain a numeric value, it will be expanded to 0 instead.