Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi , I need help to write an expression to sum on Sales by all previous year relative to the selected year. Thank you
Hi,
try something like this:
sum({$<Year={"<=$(max(Year))"}>} Sales)
I have a list box where user can select the Year. When I use your expression the number of Sales that I am getting does not change regardless of the Year selection. Should I use {1} instead of {$} ?
Also why are you sugesting max() function? Thank you
I was missing a =, the expression is:
sum({$<Year={"<=$(=max(Year))"}>} Sales)
I use max in case the user selects more than one year
best regards!
Attached is a non-Set Analysis solution that works for me - script and expressions should all be reasonably straight forward.
I'm sure it will be possible using Set Analysis but this works fine for me.
Hope that helps,
Matt - Visual Analytics Ltd
Version using Set Analysis aswell is attached - it doesn't need to use the additional YearSelect field so is probably more suited.
Essentially the solution is:
sum({1 <Year = {'<$(vYear)'}>} total Sales)
With vYear being simply =Year.
All the best,
Matt - Visual Analytics Ltd
Thank you both for greate help