Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to filter dimension Year by a variable vMinYear.
I am getting syntax error.
={<Year={$(vMinYear)}>}
Can someone give me a pointer on what I should construct this dimension filter?
Appreciated!
Have you used above line as calculated dimensions?
Anyway, you can't use a set expression stand alone, but you could use it in an aggregation function.
So either use this is calculated dimension:
= if( Year = $(vMinYear), Year)
or use a set expression like above as part of an aggregation function.
if you do a count(Sales) for example, use Year as dimension and
= count( {<Year= {$(vMinYear)}>} Sales)
as expression.
You need to do this limitation then on each expression to get a equal behaviour than using a calculated dimension.
Hope this helps,
Stefan
Have you used above line as calculated dimensions?
Anyway, you can't use a set expression stand alone, but you could use it in an aggregation function.
So either use this is calculated dimension:
= if( Year = $(vMinYear), Year)
or use a set expression like above as part of an aggregation function.
if you do a count(Sales) for example, use Year as dimension and
= count( {<Year= {$(vMinYear)}>} Sales)
as expression.
You need to do this limitation then on each expression to get a equal behaviour than using a calculated dimension.
Hope this helps,
Stefan
Thanks Stefan.
Would this syntax work with range?
= if( Year >= $(vMinYear) and Year <= $(vMaxYear), Year)
Much appreciated.
Yeah, should do.
And
= count( {<Year= {">=$(vMinYear)<=$(vMaxYear)"}>} Sales)
for the set expression should also do.
Filtering with set analysis will probably perform better, but just try both and play a little bit around.