Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
sum( {$<Year = {$(#=Only(Year)-1)}>} Sales )
In above example can you say how works '#' and 'Only'.
Thanks you
Regards,
Nihhal.
Hi Nihhal,
# is optional, so forget about it.
Only() - Returns a possible or selected value of a field, there should be only one value possible/selected otherwise it will return null.
Suppose if you select Year 2014 and 2013 Only(Year) will return null.
To overcome this Max(Year) is use.
=sum({<Year = {$(=Max(Year)-1)}>} Sales)
Regards,
Jagan.
The # is just part of the dollar sign expansion for set analysis. That functionality allows you to calculate a value to use for assignment to Year.
The only() function returns the value of the field within only if a single value is selected. So selected two years will return null instead. You can switch this to for example max(). In this case you still see values even if you have multiple years selected.
Hi,
In the above expression Only(Year)-1 means current selection of year field less one year value selected and if only one value is selected means not 2014,2013. And # is nothing here or better you select the some of this expressions
You can use some of this expressions
sum( {$<Year = {$(=Only(Year)-1)}>} Sales )
Or
sum( {$<Year = {$(=Max(Year)-1)}>} Sales )
Regards
Anand
Hi Nihhal,
# is optional, so forget about it.
Only() - Returns a possible or selected value of a field, there should be only one value possible/selected otherwise it will return null.
Suppose if you select Year 2014 and 2013 Only(Year) will return null.
To overcome this Max(Year) is use.
=sum({<Year = {$(=Max(Year)-1)}>} Sales)
Regards,
Jagan.