Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have set a variable equal to a field selection like so:
vSelectedYear = GetFieldSelections(YearField)
sometimes vSelectedYear will hold multiple values (2017, 2016, etc)
The set analysis formula looks like such right now:
sum( {<YearField = {"$(=$(vSelectedYear))"} >} [$(vType)])
this works fine if only one year is selected, but I would like it to work when vSelectedYear holds multiple years.
In Sql it would look like:
Select sum(vType)
from table
where YearField in (vSelectedYear)
It should work if you remove the double quotes (assuming integer values for years):
sum( {<YearField = {$(=$(vSelectedYear))} >} [$(vType)])
Or use the p() function or the scope operator to directly acces field values selected or possible:
sum( {<YearField = $::YearField >} [$(vType)])
sum( {<YearField = p(YearField) >} [$(vType)])
(though latter set expression should not make a difference to just the pure aggregation?)
It should work if you remove the double quotes (assuming integer values for years):
sum( {<YearField = {$(=$(vSelectedYear))} >} [$(vType)])
Or use the p() function or the scope operator to directly acces field values selected or possible:
sum( {<YearField = $::YearField >} [$(vType)])
sum( {<YearField = p(YearField) >} [$(vType)])
(though latter set expression should not make a difference to just the pure aggregation?)
Thanks! Removing the quotes did the trick!