Skip to Content
0

conditional logic *when

May 23, 2017 at 02:31 PM

55

avatar image

Hi Bpc Friends

I have a script with the following conditional logic but I don't understand the code

[ENTITY].[DEFAULT],[PRODUCTGRP].[NO_PRODGRP])>0

*WHEN COSTCENTRE
*IS *
*REC(FACTOR=(([ENTITY].[DEFAULT],[PRODUCTGRP].[NO_PRODGRP])>0),COSTCENTRE=GSSALLOC_REV)
*ENDWHEN

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin May 23, 2017 at 06:13 PM
0

Ternary syntax will be:

([ENTITY].[DEFAULT],[PRODUCTGRP].[NO_PRODGRP])>0 ? 1 : 0

Condition ? ValueIfTrue : ValueIfFalse

Factor will be equal to 1 if true and 0 if false

Show 1 Share
10 |10000 characters needed characters left characters exceeded

thanks Vadim

0
Vadim Kalinin May 23, 2017 at 03:43 PM
0

old syntax! Rewrite using ternary operator.

Share
10 |10000 characters needed characters left characters exceeded