cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Ternary Operator syntax error in BPC NW Script logic...

Former Member
0 Kudos
1,055

Have a requirement when my actuals are 0, budgets too needs to be made 0.

The script logic goes by :

*XDIM_MEMBERSET AUDITTRIAL = BAS(LN)

*XDIM_MEMBERSET INTERNAL_ORDER = BAS(P_TOTAL)

*XDIM_MEMBERSET FORECAST_ACCOUNT = BAS (B_1000)

*XDIM_MEMBERSET COSTCENTRE = NO_CC

*XDIM_MEMBERSET CUSTOMER = BAS(ALL)

*XDIM_MEMBERSET VENDOR = BAS(ALL)

*XDIM_MEMBERSET VERSION = ACT

WHEN FORECAST_ACCOUNT

*IS*

*REC (EXPRESSION=%VALUE%==0 ? % %VALUE% * -1, AUDITTRAIL=REVERSAL, VERSION=BUD, CUSTOMER = NOCUS, VENDOR = NOVEN : %VALUE%)

I am getting syntax error: "missing: in conditonal expression"

Regards,

Shrini

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


Vadim,

The 3 line which consists budget value of 5000 has got actuals(3000 (1000 + 2000)) for GL account 23456.

However, GL account 35790 doesnt have any actuals assigned to it. Hence, we dont want it.

We only want budgets which has actuals.

Internal Order, Customer and Vendor are dimensions.

Internal Order is the driver dimension.

Budgets are always with No Customer and No Vendor Combination.

Actuals will have either Customer or Vendor assgined to it.

Let me know, if you need any more inputs.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

I will try to explain myself:

For each account if:

Aggregate all records for this account for all customers, vendors and not clear about internal order for category ACTUAL. Do we need to separately aggregate each internal order?

If aggregation result is zero, then create reverse record for budget value.

Vadim

Former Member
0 Kudos

Vadim,

The aggregation is on Internal Order (Primary) and GL level.

I had given them the option of aggregating at Customers and Vendor level.

However, the client wants the Vendor and Customer information too.

Basically, they want to see Internal Orders that have actuals with the budget figures.

They dont want to see budget figures that do not have actuals.

Thanks & Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

Ok, for each combination of Internal Order and Account having some value in Budget you want to aggregate all customers and vendors and if aggregation result is zero - create negative record!

Is it correct?

former_member186338
Active Contributor
0 Kudos

And what AUDITTRAIL has the budget figures?

Former Member
0 Kudos

Vadim,

They dont want to be aggegated at Customer and Vendor level.

The scope is get actuals that are 0 for combination of IO & GL level.

Delete(or reverse) all transactions that have budgets for that combination.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

The code will be something like:

*XDIM_MEMBERSET AUDITTRIAL = AUDITFORBUDGET // AUDITTRAIL ID where BUD figures are stored

*XDIM_MEMBERSET INTERNAL_ORDER = BAS(P_TOTAL)

*XDIM_MEMBERSET FORECAST_ACCOUNT = BAS(B_1000)

*XDIM_MEMBERSET COSTCENTRE = NO_CC

*XDIM_MEMBERSET CUSTOMER = NOCUS

*XDIM_MEMBERSET VENDOR = NOVEN

*XDIM_MEMBERSET VERSION = BUD

*WHEN FORECAST_ACCOUNT

*IS *

*REC(EXPRESSION=(([CUSTOMER].[ALL],[VENDOR].[ALL],[VERSION].[ACT],[AUDITTRIAL].[LN])==0) ? -%VALUE% : 0,AUDITTRAIL=REVERSAL)

*ENDWHEN

Vadim

Former Member
0 Kudos

Vadim,

The Actuals are base members of LN and Budgets come from V600.

Actuals have Customers/Vendors attached to them; whereas all Budgets dont have any Customer/Vendor information.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

I am not talking about aggregation on customer or vendor level, I am talking about sum of all customers and vendors for each combination of IO & GL (also sum of all AUDITTRAIL). Look on the code!

former_member186338
Active Contributor
0 Kudos

Then:

*XDIM_MEMBERSET AUDITTRAIL = V600

Vadim

P.S. The scope will select all budget values and test the condition!

Former Member
0 Kudos

Thanks a lot, Vadim...Appreciate your time and knowledge. Will update you about the results on Monday....

Former Member
0 Kudos

*REC(EXPRESSION=(([G_CUSTOMER].[ALL],[G.VENDOR].[ALL],[G_VERSION].[ACT],[AUDITTRAIL].[LN])==0) ? -%VALUE%, AUDITTRAIL=REVERSAL : %VALUE%)


The logic is that

For All customers and Vendors, Audittrail is LN Actuals that are 0

Budgets would be -1* value with AuditTrail = Reversal.

If false, there should be no change...

However, this throws an syntax error :" missing : in conditional expression"

former_member186338
Active Contributor
0 Kudos

Please read my first reply, you are using INCORRECT syntax of the ternary operator!

Former Member
0 Kudos

Vadim,

When I use the logic as stated by you :

*REC(EXPRESSION=(([G_CUSTOMER].[ALL],G_VENDOR].[ALL],[GVERSION].ACT],[AUDITTRAIL].[LN])==0 ? -%VALUE% : 0, AUDITTRAIL = REVERSAL)

It creates records with 0 and AUDITTRAIL = REVERSAL, for the condition false.

I dont see any records for budget with negative sign in Audittrail - Reversal.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

But why do you think that incorrect syntax will create any records?

My code will create records if you correctly explained where you have the values. Please show UJKT log.

Vadim

Former Member
0 Kudos

Vadim,

If

IO-GL-Vendor/Customer-Actual (Version)-LN (Audittrail) is 0

        -1 * IO-GL-Vendor/Customer-Budget (Version) - V600 (Audittrial)

Else

Do Nothing

EndIf

Have created a member called Reversal in Audittrail to capture the reversal Budget figures, which would satisfy the above condition.

Created a parent 600 which has children V600 and Reversal.

Hope, this makes it clear.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

Sorry,

But "IO-GL-Vendor/Customer-Actual (Version)-LN (Audittrail) is 0

        -1 * IO-GL-Vendor/Customer-Budget (Version) - V600 (Audittrial)" - not clear!

Please write conditions line by line...

"Do Nothing" - not possible, you have to write something!

Can be:

0 - if you have no data in target

([...].[...],...) - tuple equivalent to target (write target over target)

Vadim

Former Member
0 Kudos

Vadim,

Thanks for all the help.

It works. Managed to crack it.

Would like to meet you in person one day.

Appreciate your time and effort in answering all my queries....

Regards,


Shrini

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Hi Shrini,

The syntax is incorrect!

The correct syntax is:

*REC(EXPRESSION=(condition) ? ExpressionIfTrue : ExpressionIfFalse, DIM1=...,DIM2=...)

Dimension override can't be a part of ternary operator!

Please explain the logic you want to achieve!

Vadim

P.S. If you want to write to 2 different intersections - you have to use 2 REC lines with ternary operators!

Former Member
0 Kudos

Appreciated and thanks for taking out time to reply my query.

Had a hunch that you would respond to this query, as I have read about your notes on the ternary operator.

Let me illustrate the logic with an example:

IO            FORECAST ACCOUNT      CC             CUSTOMER  VENDOR          ACTUAL      BUDGET

100000    23456                                  NO_CC      12345             NOVEN            1000

100000    23456                                  NO_CC                             98765               2000

100000    23456                                  NO_CC       NOCUS         NOVEN                                 5000

100000    35790                                  NO_CC       NOCUS         NOVEN                                 7000

Would like to have the first 3 lines and not the 4th one.

I would like keep budget values, which have actuals for Forecast Account but would like to delete or reverse (using AUDITTRAIL - Reversal) for budget values, which dont have any actuals or actuals are 0. (In this example Forecast Account 35790).

Hope, this makes it more clear.

Regards,

Shrini

former_member186338
Active Contributor
0 Kudos

The logic is hard to understand

Please explain the logic for keeping the 3rd line!

Let's forget about column with COSTCENTRE = NO_CC

What about combination of INTERNAL_ORDER,CUSTOMER and VENDOR?

Vadim