Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
sum({<Year= {"$ (>=(Max(Month))"}>}Sales)
A bit confused, what if i put = sign before $ sign in string? Please let me know the difference
sum({<Year= {"=$ (>=(Max(Month))"}>}Sales)
When ever you use = sign QV takes what ever it reads after = sign as an expression to be evaluated then compared to the field Year. May be not a good way of explaining. But that is what i believe. May be someone can give more insights on this.
I don't think either of the examples you posted would be valid syntax. Both would return null. Here are some similar examples with valid sytax.
sum({<Year={2008}>}Sales)
Select the specific value 2008
sum({<Year={">=2008"}>}Sales)
Select >=2008. Use of the >= requires the double quotes.
Now using $() Dollar sign expansion (DSE) to provide a dynamic value. DSE is executed first to create a substitution, then then the expression is evaluated.
sum({<Year={$(vYear)}>}Sales)
Select the value of variable vYear.
sum({<Year={$(=Max(Year))}>}Sales)
Select the Max possible Year. Requires DSE. The = after the left paren indicates this should be evaluated as an expression.
sum({<Year={">=$(=Max(Year))"}>}Sales)
Same as above but testing for >=. Note that >= requires the double quotes. The >= goes before the DSE.
Some further reading.
The Magic of Dollar Expansions
-Rob
Thanks Rob,
There was syntax error in expression.
Please help me in understanding significance of '=' sign before $
Sum({<Year={"=$(=Max(Year)-1)"},Month={'<=$(vMaxMonth)'}>}Sales)
Sum({<Year={"$(=Max(Year)-1)"},Month={'<=$(vMaxMonth)'}>}Sales)
Sum({<Year={"=$(=Max(Year)-1)"},Month={'<=$(vMaxMonth)'}>}Sales)
As far as I know it is not valid to place a "=" before the "$" in this context. Does this expression return results for you?
-Rob
Hi Rob,
I am getting results if i put '=' sign before $. But it is different from without '=' sign.
I was checking this just out of curiosity.
Is the result of
Sum({<Year={"=$(=Max(Year)-1)"},Month={'<=$(vMaxMonth)'}>}Sales) same as
Sum({<Month={'<=$(vMaxMonth)'}>}Sales) or
sum(Sales) ?
No