Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I was reading up on the dollar-sign expansion in Qlikview. Below is an excerpt on page 239 in
the Qlikview Reference Manual. The last comment where they say "returns the year before the selected one".
Are they simply referring to the previous year? The verbage "... before the selected one" confuses me a bit.
------------
Dollar-Sign Expansion with an Expression
Expressions can be used in dollar-sign expansions. The content between the brackets must then start
with an equal sign:
$( =expression )
The expression will be evaluated and the value will be used in the expansion.
Example:
$(=Year(Today())); // returns e.g. '2008'
$(=Only(Year)-1); // returns the year before the selected one
------------
only function returns value only of you selected one value in a field
so in this case
it means the user selected one value in the year field
and the expression will return the value of the year before , otherwise the expression will return null
this is related to the only function and not to the $ sign
Yes previous year based on your selection. If you have selected 2007, then Year - 1 would be 2006
Hi,
The -1 just means the value before. If 2008 is select the $(=Only(Year)-1) would show 2007
Take a look at the attached.
Bill
OK, so it's either the previous year (if a year is selected) or blank if no year is selected.
I got it now and thanks for the code snippet.