Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have an expression in one of my objects that look like this:
IF(vVar=1,sum(IF(StatusChange<>'Deleted',Revenue)),sum(IF(StatusChange<>'Deleted',Contribution)))
It has worked fine, until today when I realized that using a bookmark didn't trigger my variable that is defined when selecting a specific field, call it Field1. In other words, when I select Field 1 (which is a check box) I have a trigger on that field that are setting the variable vVar = 1.
Instead of using the variable vVar as IF clause I would like to use the value of the field as IF clause to use either Revenue or Contribution as stated above. Something like:
IF(Field1='Value',sum(IF(StatusChange<>'Deleted',Revenue)),sum(IF(StatusChange<>'Deleted',Contribution)))
.. but I can't get it work. How to do this?
Thanks in advance!
Best regards,
Filip
Hi
Without your qvw or at least a sample and you don't describe the object in which the problem is occurring, so I can only guess - but here goes. I suspect that you have more than one possible value of Field1in the object at the point where you are trying to evaluate the expression.
If you want to detect if something is selected in Field1, you can use GetSelectedCount(Field1) or GetPossibleCount(Field1).
If you want to detect the one and only value selected, try If(Only(Field1) = 'Value',..)
If you want to detect if Field1 is one of several possible values, then use something like this
If(WildMatch('.' & Concat(Field1, '.') & '.', '*.Value.*'), ....)
Hope that helps
Jonathan
Did you tried the below script ?
Set vTemp='Value'
IF(Field1=$(vTemp),sum(IF(StatusChange<>'Deleted',Revenue)),sum(IF(StatusChange<>'Deleted',Contribution)))
I'm sorry, it doesn't work..
The value is present or not confirm first.
Hi
Without your qvw or at least a sample and you don't describe the object in which the problem is occurring, so I can only guess - but here goes. I suspect that you have more than one possible value of Field1in the object at the point where you are trying to evaluate the expression.
If you want to detect if something is selected in Field1, you can use GetSelectedCount(Field1) or GetPossibleCount(Field1).
If you want to detect the one and only value selected, try If(Only(Field1) = 'Value',..)
If you want to detect if Field1 is one of several possible values, then use something like this
If(WildMatch('.' & Concat(Field1, '.') & '.', '*.Value.*'), ....)
Hope that helps
Jonathan
Thanks for your replies!
GetSelectedCount(Field1) solves my problem as Field1 is a checkbox with only one possible value.
Best regards,
Filip