Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Say I have an expression like so:
Sum({<[Type]={'A'}>}Cost)
I also have a list box for [Type]. And [Type] has A,B,C, etc. I noticed that even if I select [Type]='B' from the list box, the expression above still calculates. Is it possible to have the expression calculate a zero being that Type=A is not part of current selection?
The set expression that you use starts from the current selection, but overrides the selection for field Type by forcibly setting it to value 'A'. By specifying the set expression [Type]={'A'}, you are effectively undoing the selection in field Type and putting a new one in place. All other current selections will remain unchanged.
To accomplish what you want, you can use combination operators like -= or *=. The latter is especally useful as it means (temporarily) assign to the field the intersection of the current selection with whatever I specify between braces. Example:
=Sum({<[Type] *= {'A'}>} Cost)
will throw away all currently selected Type values except for value 'A'. If value 'A' wasn't selected to begin with, it will stay unselected in this expression.
may be this?
Sum({1<[Type]={'A'}>}Cost)
Try Sum({$<[Type]={'A'}*P([Type])>}Cost)
The set expression that you use starts from the current selection, but overrides the selection for field Type by forcibly setting it to value 'A'. By specifying the set expression [Type]={'A'}, you are effectively undoing the selection in field Type and putting a new one in place. All other current selections will remain unchanged.
To accomplish what you want, you can use combination operators like -= or *=. The latter is especally useful as it means (temporarily) assign to the field the intersection of the current selection with whatever I specify between braces. Example:
=Sum({<[Type] *= {'A'}>} Cost)
will throw away all currently selected Type values except for value 'A'. If value 'A' wasn't selected to begin with, it will stay unselected in this expression.