Skip to Content

script logic lookup and rec expression

Hi BPC Friend

I am in trouble to understand the meaning of the three rows in bold

*SELECT(%MYTIME%,ID,TIME,BUD_FCST_DRS=IN_BPF)

*LOOKUP Reporting

*DIM FLAG1000:ACCOUNT="FL1000"

*DIM FLAG1000:FLOW="F_CLO"

*DIM PGIND1000:ACCOUNT="ROY_005"

*DIM PGIND1000:FLOW="PUB_GROUP"

*DIM PGDEP1000:ACCOUNT="ROY_005"

*DIM PGDEP1000:PRODUCTGRP="ALL_PRODGRPS"

*DIM PGDEP1000:FLOW="PUB_GROUP"

*DIM FLAG1005:ACCOUNT="FL1005"

*DIM FLAG1005:FLOW="F_CLO"

*DIM PGIND1005:ACCOUNT="ROY_001"

*DIM PGIND1005:FLOW="PUB_GROUP"

*DIM PGDEP1005:ACCOUNT="ROY_001"

*DIM PGDEP1005:PRODUCTGRP="ALL_PRODGRPS"

*DIM PGDEP1005:FLOW="PUB_GROUP"

*ENDLOOKUP

*XDIM_MEMBERSET CATEGORY=NYBUDGET

*XDIM_MEMBERSET CHANNEL=NO_CHANNEL

*XDIM_MEMBERSET COSTCATEGORY=NO_COSTCAT

*XDIM_MEMBERSET DATASRC=IN_BPF

*XDIM_MEMBERSET ENTITY=%ENTITY_SET%

*XDIM_MEMBERSET FLOW=BAS(PUB_GROUP),PUB_GROUP,F_CLO

*XDIM_MEMBERSET GROUPS=G_NONE

*XDIM_MEMBERSET INTCO=I_NONE

*XDIM_MEMBERSET PRODUCTGRP=BAS(ALL_PRODGRPS)

*XDIM_MEMBERSET RPTCURRENCY=LC

*XDIM_MEMBERSET TIME=%MYTIME%

*WHEN_REF_DATA=MASTER_DATA

*WHEN ACCOUNT

*IS FL1000

*WHEN FLOW

*IS F_CLO

*WHEN PRODUCTGRP

*IS<>PG_8001

*REC(EXPRESSION=(LOOKUP(FLAG1000)==1&&LOOKUP(PGIND1000)==0)?1:2,ACCOUNT=CL1000)

*REC(EXPRESSION=(LOOKUP(FLAG1000)==2&&LOOKUP(PGIND1000)!=0)?1:2,ACCOUNT=CL1000)

*REC(EXPRESSION=-2,ACCOUNT=CL1000)

*ELSE

*REC(EXPRESSION=(LOOKUP(FLAG1000)==1&&LOOKUP(PGDEP1000)==0)?1:2,ACCOUNT=CL1000)

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 24, 2016 at 12:45 PM

    I am not a cryptanalyst to explain what was the idea of the code author :) I don't even know if it's a working code or not!

    You have to explain the logic to be achieved and I will help with the code.

    Just about syntax:

    *DIM FLAG1000:ACCOUNT="FL1000"
    *DIM FLAG1000:FLOW="F_CLO"

    means that LOOKUP label FLAG1000 has the mentioned dimensions scoped.

    *REC(EXPRESSION=(LOOKUP(FLAG1000)==1&&LOOKUP(PGIND1000)==0)?1:2,ACCOUNT=CL1000)

    If (LOOKUP(FLAG1000)=1 AND LOOKUP(PGIND1000)=0) then result=1 else result=2

    And result will be stored in ACCOUNT=CL1000

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 24, 2016 at 03:08 PM

    WHEN/ENDWHEN always aggregate values written to the same destination.

    And commit has absolutely no relation to when/endwhen loop (used only with MDX calculations, not with when/endwhen).

    You have to spend some time working with some test code in UJKT to understand basic things...

    Add comment
    10|10000 characters needed characters exceeded