Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dollor sign expression set analysis

Hello

Im confusing myself, so i need some one to explain me some difference

when you eg. have expressions like this

sum({$<Year={$(vPreviousYear)}, Product=>} amount)

or

sum({<Year={$(vPreviousYear)}, Product=>} amount)

or

sum({$<Year={(vPreviousYear)}, Product=>} amount)

or

sum({1<Year={$(vPreviousYear)}, Product=>} amount)

or

sum({1<Year={1(vPreviousYear)}, Product=>} amount)

Can somebody tell me the difference between each or what each expression do?

what if i have this expression

sum({$<Year={$(vPreviousYear)}, Product=>} amount) - Can i then also have $ before Product? or how would you express that? or would you say Product=$something ??

2 Replies
Gysbert_Wassenaar

sum({$<Year={$(vPreviousYear)}, Product=>} amount)

sum({<Year={$(vPreviousYear)}, Product=>} amount)

These two are almost always equivalent. Only when you're using alternate states that may not be true. It sums amount using the default selections, but overriding selections in Year with whatever is stored in the variable vPreviousYear and disregarding any selections in Product.

sum({$<Year={(vPreviousYear)}, Product=>} amount)

This one doesn't dollar-expand the variable, so I don't think it will work correctly

sum({1<Year={$(vPreviousYear)}, Product=>} amount)

The 1 ignores all selections, so Product= is redundant. And Year is set to the value stored in the variable vPreviousYear.

sum({1<Year={1(vPreviousYear)}, Product=>} amount)

The second 1 is incorrect and the variable isn't dollar-expanded so this expression won't work correctly.


talk is cheap, supply exceeds demand
Not applicable
Author

So bascially you could just be satisfied with sum({<Year={$(vPreviousYear)}, Product=>} amount) in most cases?