if/then calculation
I have a category field and a number field
I would like to have a calculation based on these three as follows:
if category a is selected then number x 40% shows
if category b is selected then number x 60% shows
if both category a and b are selected then number shows
Can anyone assist on this?
-
This should work. It's pretty easy. You just need to give every category option the percentage you'd like to see, then add them together and multiply by your number. It would be far more difficult if you had multiple options that, when combined, wouldn't equal 100%
var rItem = @Category;
var SelectionA = rItem.indexOf ("a") >= 0 ? .40 : 0;
var SelectionB = rItem.indexOf ("b") >= 0 ? .60 : 0;
(SelectionA + Selection B) * @Number)
Please sign in to leave a comment.
Comments
1 comment