Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I was looking at an app that someone developed. One of the charts has this expression:
= sum({<_RevenueFlag-={1}>} TransactionAmountInDollars)
I believe it means sum the TransactionAmountInDollars where _RevenueFlag = 1. However I noticed there is what
appears to be a minus or hyphen symbol between _RevenueFlag and the equal sign. Can someone explain what that
means or what this expression maybe doing?
Thanks
It means sum TransactionAmountInDollars where _RevenueFlag is not equal to 1
Sunny, thanks for the quick response. Personally I would coded it as _RevenueFlag = (0) since it can only be
0 or 1. This is much clearer.
I agree. Its much more easier to understand
All _RevenueFlag of the selection except -1
maxgro,
Can you please explain what "except -1" mean? I have only been working with QV for a few weeks.
Thanks
-1 is excluded, so you will see everything else.
Hi Sidney,
We need to be a bit careful here, the expression
= sum({<_RevenueFlag-={1}>} TransactionAmountInDollars)
will not include in the calculation records that have RevenueFlag = 1 or that have null RevenueFlag. In your case as the flag is always non-null this is not a consideration but it should be bourne in mind.
If I can use your example as an illustration, if some of your records had null RevenueFlag and you wanted to sum up all that were not set to 1 in this field then the expression
= sum({$-<_RevenueFlag={1}>} TransactionAmountInDollars)
would include the records in the default selection state with null RevenueFlag and also non-nulls <> 1.
Thanks Andrew and others who responded. I will need to go through these samples myself to see how the results come out when I play around with this expression.