Skip to Content
avatar image
Former Member

conditional logic *when

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 23, 2017 at 06:13 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2017 at 03:43 PM

    old syntax! Rewrite using ternary operator.

    Add comment
    10|10000 characters needed characters exceeded