Post

3 followers Follow
0
Avatar

If formular

I have a category with the following fields; A, B, C

And would like a calculation to do:

If A = 100

If B = 200

If C = 300

Tried different solutions but can't make it succeed.

Michael Bisgaard

Please sign in to leave a comment.

3 comments

0
Avatar

Hi Michael,

var cat = @Category field;
cat == "A" ? 100 : cat == "B" ? 200 : cat == "C" ? 300 : 0;

Rainer

Rainer Grabowski 0 votes
Comment actions Permalink
0
Avatar

var cat= @Category
if ( cat == "A" ) {
100
}
else if ( cat == "B") {
200
}
else if ( cat == "C") {
300
}
else {
null
}

kareem ahmed asfour 0 votes
Comment actions Permalink