Member ID checks in Script Logic

I thought I saw a note recently that the 7.5MS version of BPC added a new feature to check that the Member IDs being written to in a *REC statement would be validate so that you would avoid the problem of invalid member id's in the cube. However, when I read the release notes I see no mention of this. Has anyone else seen information on this issue and if so can you point me to it?

Thanks Anis, I saw the notes on the checks when you validate and save. I was wondering if you are dynamically creating the Member ID if it will valdate the Member ID during logic execution before it writes the record. For instance, if I am pushing data from Payroll to Finance and the Account Member I should write to is based on a property on the PayAccount Dimension my REC statement might look like this
*REC(Factor=1,Account=PayAccount.GLAccount)
The system cannot validate this when I validate the logic. If the property is not set up correctly it will try to write the data using the value in the property. In versions up to 7.5 it would simply write the record to the Fact table with the invalid Account Member ID. When you process the App you would then get an error noting that there were invalid member IDs in the cube.

Similar Messages

  • Conditional Checking in Script Logic

    Could anyone please kindly enlightened me how I could code the following in the script logic?
    Scenario:
    IF A > 0, THEN B = C * D
    I have tried with SELECTCASE statement statement but all wouldn't work, I keep getting errors...
    SELECTCASE:
    *SELECTCASE [P_ACCT].[0005]
    *CASE > 0
             *REC(EXPRESSION= ([P_ACCT].[0004] * [P_ACCT].[0003]), P_ACCT=0001)
    *ENDSELECT
    Error:
    UJK_VALIDATION_EXCEPTION:Unknown or unimplemented keyword "*REC(EXPRESSION=IIF([MATERIAL].[LDG0005]=>0,([MATE"...
    Thank you very much in all advances.
    Best regards,
    Yen Li

    Hi Yen Li,
    Applying SELECTCASE - ENDCASE combination would not produce the desired results. Instead, use Validation Business Rules - by setting up Validation Rules and Validation Rules Details and run the Stored Procedure SPRUNVALID from the Default Logic to execute these validation rules. Call the Stored Procedure by the following syntax:
    RUN_STORED_PROCEDURE=SPRUNVALID(u2018applicationu2019,u2019categoryu2019,u2019currencyu2019,u2019%SCOPETABLE%u2019,u2019%LOGTABLE%u2019)
    Your command: u201CIf P_ACCT.0005 is > 0, multiply P_ACCT.0004 by P_ACCT.0005 and post the product in P_ACCT.0001. Otherwise do not do anything.u201D will be shown in result!
    Regards.
    Chakrapani

  • Script Logic - Check Work Status

    Hi,
    I am using the standard process chain "/CPMB/DEFAULT_FORMULAS_LOGIC" to trigger Script logic file.
    I have created some logic to clear and copy data to a targer category. I want to check the workstatus of the target category and if it is locked i want to clear/copy to fail.
    I am not sure how to go about this? I was thinking of adding the following but that is just a guess!
    TASK(/CPMB/CLEAR_SOURCE_CUBE,CHECKLCK,1)
    any advice would be helpful.
    Thanks,

    Hi,
    Ideally did want an option for the user to select option to check whether the copy should happen if the data had been locked. Have done this via the standard COPY package.
    Can this be done with the script logic e.g. using paramters in the package?
    Or if you create a script logic file does it always check the workstatus?
    thanks

  • Script Logic to Calculate average or sum based on parent member involving

    Hi ! freinds,
    I am trying to write script logic to calclate
    sum  of previous 2 months for  one group account having 100 childrens and write to DIFFERENT INPUT ACCOUNT . Please suggest the best practive to calculate the value.
    I tried with : *WHEN *IS / *ENDWHEN  its is not possible to define
    when ACCT
    is BAS(Group Account)----
    NOT SUPPORTED
    Rec .....
    ENDWHEN
    Please help

    Vishwanath,
    Are you trying to calculate an average by account for the two months or an average of all accounts?
    Ex 1
              Feb   Mar  Avg
    acct1 1000   500   750
    acct2 1000  1000 1000
    Ex2
             Feb   Mar
    acct1 1000   500
    acct2 1000  1000
    Avg 1000   750
    Akos

  • Validate my script logic: reference erro LOOKUP is not defined

    Dear all,
    i want write one script logic. It use LOOKUP using FOR/NEXT.
    But when i check stament in my script logic: messesage erro: reference erro LOOKUP is not defined.Can you help me?
    My script logic
    *XDIM_MEMBERSET ACCOUNT=BS221
    *XDIM_ADDMEMBERSET CATEGORY = Actual
    *XDIM_ADDMEMBERSET ENTITY = CSO
    *SELECT(%TIME%,"[ID]",TIME,"[ID]>=2006.01 AND [ID]<=2006.02")
    *XDIM_MEMBERSET TIME = %TIME%
    *LOOKUP Rates
    *DIM  CATEGORY ="Actual"
    *DIM R_ACCOUNT ="AVG"
    *DIM R_ENTITY ="Global"
    *DIM INPUTCURRENCY="USD"
    *DIM MEASURES ="PERIODIC"
    *FOR %T% = %TIME%
    *DIM RATE_%T%: TIME =%T%  
    *NEXT
    *ENDLOOKUP
    *WHEN ACCOUNT
    *IS "BS221"
    *FOR %T1% = %TIME%
    *REC(EXPRESSION=LOOKUP(RATE_%T1%),TIME=%T%)
    *NEXT
    *ENDWHEN
    *COMMIT
    Thanks,
    Hungth

    Dear Vadim,
    I want test LOOKUP statement using FOR/NEX, then get value per member for member in LOOKUP.
    in excel add-in of Rates Model:
    Actual - Actual
    Average Rate
    Global Entity
    2006.01 - Jan 2006
    31
    2006.02 - Feb 2006
    30
    2006.03 - Mar 2006
    30
    2006.Q1 - Q1 2006
    30
    I want run my script logic above to get value from Rates Model ( 2006.01: 31, 2006.02 : 30, 2006.03: 30 ) to current model , to calculate in crurrent model.
    BS221 - Long Term Debt
    2006.01 - Jan 2006
    2006.02 - Feb 2006
    2006.03 - Mar 2006
    Actual - Actual
    31
    30
    30
    How i can write my script logic? My script logic statements is correct??
    Thanks,
    hungth

  • An error in Script Logic

    Hi Experts,
    I have a problem with one of the FXTranslation logicu2019s in one of my report can u please help me on that.
    The logic works fine for 2 reports out of 3, for the 3rd report I donu2019t know why itu2019s not doing the translation to USD. As far as the design of the report goes the 2 reports for which translation works fine comprises of 2 logics one for percentage allocation and other for translation from LC to USD, whereas the 3rd report needs only translation but doesnu2019t need the allocation logic to be run.
    The conversion for the 3rd report happens if I comment out the allocation logic. Both these logics are mapped to Default.LGF file. I am unable to figure out what could be the error.
    Below is the Script Logic for Aloocation and Translation:
    //Budget Allocation
    *SELECT(%CURR%,"[ID]","RPTCURRENCY","[CURRENCY_TYPE]='L' OR [CURRENCY_TYPE]='R'")
    *XDIM_MEMBERSET RPTCURRENCY=%CURR%
    *RUNALLOCATION
    *FACTOR=USING/1
    *DIM ACCOUNTB WHAT=[IS_ALLOC]='Y'; WHERE=<<<; USING=ALLOCPER
    *DIM PRODUCTM WHAT=NOPRODUCT; WHERE<>NOPRODUCT; USING=<<<
    *ENDALLOCATION
    *COMMIT
    // Currency Translation
    *SELECT(%REPORTING_CURRENCIES%, "[ID]", "RPTCURRENCY", "[REPORTING] = 'Y'")
    *SELECT(%FX_RATES%, "[ID]", "RATE", "[GROUP] = 'FX RATE'")
    // Load the rates from the RATE cube
    *LOOKUP RATE
                *DIM CATEGORY="BUDGET"
         *DIM RATEENTITY="GLOBAL"
         *DIM RATE=ACCOUNTB.RATETYPE
         *DIM SOURCECURR:INPUTCURRENCY=LEGALENTITY.CURRENCY
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *DIM %CURR%:INPUTCURRENCY="%CURR%"
         *NEXT
    *ENDLOOKUP
    //  define the translation rule
    *WHEN ACCOUNTB.RATETYPE
    *IS "NOTRANS"
         // skip
    *IS %FX_RATES%
               // translate
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *REC(FACTOR=LOOKUP(%CURR%)/LOOKUP(SOURCECURR),RPTCURRENCY="%CURR%")
         *NEXT
    *IS "COPYLC"
         // take as is
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *REC(RPTCURRENCY="%CURR%")
         *NEXT
    *ENDWHEN
    *COMMIT
    // Default
    // FX Translation
    *include FXTranslation.lgf
    // Budget Allocation
    *include BudgetAllocation.lgf

    Hi Naresh,
    One thing that helped me solve the problem was I needed to use different set of Dimension members/property in the Logic i.e What, Where and Using to trigger off the Curency Translation.
    But please make sure that you use try to understand a unique dimension (member/property) used and use that to trigger off the translation or anything for that matter. My other two translations were working fine as the parameters i used were unique for them whereas the remaining one needed alteration in the logic only in the parameters used in What, Where and Using, so had to add one more set of Translation Logic for this exclusively.
    Another point you need to check in your Rate Application is whether you have your Reporting Currency as value 1, say for eg USD is your reporting currency then the value in Rate Application for USD must be 1, if u by mistake cleared of this value when using the Clear Data Manager Package so the multiplication with 0 results in no conversion.
    These were the two points that helped me solve my issue. I hope it helps.
    Rgds,
    Rizwan
    Edited by: Rizwan Mustaffa on Jul 13, 2009 12:09 PM

  • Fetching property value in script logic!!

    Hello Experts,
    We are using BPC 7.5 M, I am working on a script logic and need to fetch a value of a property of a dimension member where dimension member is itself defined in some property.
    We have a Org dimension which has a property "FORECAST_UNIT" and this property contains a member Id of Org dimension itself, In my script logic I need to fetch value of "Currency" property for the Org dimension member defined in "FORECAST_UNIT" property.
    Please Advice.
    Thanks & Regards,
    Rohit

    Hi Roberto,
    Attached code (In Image) is of our Aggregate Forecast Unit logic, Every Org (Entity) has an forecasting unit defined in Forecasting unit property in Org dimension and Forecasting unit is also a member of Org dimension, below logic aggregates the data at Forecasting unit level:
    The issue is that I need to check before the code marked in Red executes that if Org-- Forecasting unit -- Currency is USD then only Red part of logic should execute.
    Thanks & Regards,
    Rohit

  • Script logic from BPC 5 in BPC 7.5

    Hi,
    I am trying to use some script logic from an appset in BPC 5 in BPC 7.5. When I validate the logic in 5 it works fine but in 7.5 I get validation errors.
    They relate to properties of dimension elements that are not currently used (neither in 5 nor in 7.5) but could well be used in the future. As an example, this bit generates an error
    *WHEN ACCOUNTL.RATETYPE
    *IS END,ENDFLOW
    I currently do not have an account defined with ratetype END but it is quite possible that there will be one in the future. And END is defined as an element in the RATE dimension.
    So, why did BPC 5 accept this and BPC 7.5 does not? And, is there a way around other than defining a dummy element in ACCOUNTL that used ratetype END?
    Thanks
    Edited by: ArnoldWarhonowicz on Aug 5, 2010 4:06 PM

    What I havenoticed is that with the new7.5 Script logic, there are more checks and balances performed during the validation.  So, if you have only AVG, ENDRATE on RATETYPE property and no END for any member, yet your logic is calling a set of members with this parameter, the logic fails to validate. I assume the process is checking for a set of END members based on the request. Since they don't exist, the error occurs.  But I would request that BPC Support verify the behavior as well.
    If you remove END, does the logic validate?
    Hope this helps.

  • Error during script logic processing from UJKT tcode

    Hi,
    When I try to execute the script logic through UJKT tcode, it gives me the following exception:
    UJK_EXECUTION_EXCEPTION:Runtime error Duplicate recordMember (D_AUTO_UAE) of dimension (DIVISION) is not a valid member.
    Following is the script logic:
    *RUN_PROGRAM VALIDATION
       CATEGORY = %CATEGORY_SET%
       GROUP= %GROUPS_SET%
       TID_RA = %TIME_SET%
    *ENDRUN_PROGRAM
    BAdi used is BADI_UJ_CUSTOM_LOGIC
    Also the error log displays entire set of data records, instead I will like to see only the status of whether it went successful or not.
    Where can I check this setting?
    Please help.
    Thanks and Regards,
    Pankaj

    Hi Pankaj,
    I would request you to re-process the DIVISION deimension (preferrably all the dimensions). Then re-process and optimize the application. See, if you are getting any errors or not.
    Hope this helps.

  • BPC Script Logic - XDIM_FILTER results in error

    I am writing a Script Logic in BPC and I need it to include all records where the DESTINATION dimension member has the Dimension Property of PLANDEST = "Y"
    This approach works:
    *SELECT(%DestinationMbrs%,"[ID]","Destination","[PlanDest] = 'Y'")
    *XDIM_MEMBERSET DESTINATION = %DestinationMbrs%
    This approach does not work:
    *XDIM_MEMBERSET DESTINATION = <ALL>
    *XDIM_FILTER DESTINATION=[DESTINATION].PROPERTIES("PlanDest")="Y"
    It results in the error message at runtime:
    Error in step 1 of QueryCubeAndDebug: -2147467259 Query (1,156) The PLANDEST dimension attribute was not found.
    The reason I would like to use the second approach is that the first approach relies on the SELECT statement.  The documentation on the SELECT statement says:
    The *SELECT statement is executed at the time the logic is validated, and the expanded result is
    written in the LGX file. This means that if the related dimension is modified, it may be necessary
    to re-validate the rules.
    So if I change the DESTINATION dimension members PLANDEST flags, I need to re-validate the script logic.  That is a maintenance nightmare and a problem waiting to happen.
    How do I solve this so that the dimension attribute is evaluated at runtime, not at logic validation time?

    As Yuan Said, if you are using MDX logic and want to use property, you should check Inapp at the 'manage property' menu of admin console.
    Usually, InApp sholud not be selected for better performance of MDX query. (SAP recommendation)
    But. Here are two cases that you should select.
    1. MDX logic in the logic script.
    2. Dimension formula.
    I hope it will make clear for all.
    James Lim

  • Script Logic - Calculated Members

    Hello:
    Im trying to build a script member using calculated members:
    *WHEN CUENTA
    *IS U4000
    *ENDWHEN
    *COMMIT
    U4000 is a calculated member in the account dimension member. I tried using another account, that is not a calculated member and it works.
    How can use calculated member in this sintax?
    Thanks in advance.
    Luciana

    I would like to mention few things:
    1. OLAPLOOKUP it doesn't work anymore into 7.5. James can you double check. My tests is showing that OLAPLOOKUP is not even validate into 7.5
    2. Calc_Dummy_Org it is an option to get the values of calculate members
    3. It is strange that kind of condition because into script logic you are doing input for base members.
    So that condition to test when an account is a an account which is not base member for me doesn't seems to be right.
    I can understand if you are looking about the value of that account but not testing if an account it is an account which is not base member.
    So if you want to record something with value of your calculate member just use:
    *BEGIN
    ACCOUNT.#basememberforinput = ACCOUNT.Calculatemember
    *END
    *COMMIT
    Edited by: Sorin Radulescu on Nov 9, 2010 4:04 PM

  • Which is faster - Member formula or Calculation scripts?

    Hi,
    I have a very basic question, though I am not sure if there is a definite right or wrong answer.
    To keep the calculation scripts to a minimum, I have put all the calculations in member formula.
    Which is faster - Member formula or calculation scripts? Because, if i am not mistaken, FIX cannot be used in member formulas, so I need to resort to the use of IF, which is not index driven!
    Though in the calculation script,while aggregating members which have member formula, I have tried to FIX as many members as I can.
    What is the best way to optimize member formulas?
    I am using Hyperion Planning and Essbase 11.1.2.1.
    Thanks.

    The idea that you can't reference a member formula in a FIX is false. Here's an example:
    - Assume you have an account that has a data storage of Stored or Never Share.
    - This account is called Account_A and it has a member formula of Account_B * Account_C;.
    - You would calculate this account within a FIX (inside of a business rule) something like this:
    FIX(whatever . . . )
    "Account_A";
    ENDFIX
    If you simply place the member named followed by a semi-colon within a business rule, the business rule will execute the code in the in that member's member formula.
    Why would you want to do this instead of just putting ALL of the logic inside the business rule? Perhaps that logic gets referenced in a LOT of different business rules, and you want to centralize the code in the outline? This way, if the logic changes, you only need to update it in one location. The downside to this is that it can make debugging a bit harder. When something doesn't work, you can find yourself searching for the code a bit.
    Most of my applications end up with a mix of member formulas and business rules. I find that performance isn't the main driving force behind where I put my code. (The performance difference is usually not that significant when you're talking about stored members.) What typically drives my decision is the organization of code and future maintenance. It's more art than science.
    Hope this helps,
    - Jake

  • Script Logic: Using a property in MDX *REC statement (BPC NW)

    Hi,
    Is it possible to use a Property in an MDX statement without using  *LOOKUP() function? I have script successfully working but it takes 15 minutes to execute and would like to speed it up.
    I understand that [DIMENSION].[MEMBER].Property is not valid syntax, and do not believe NW has any other functions to resolve the issue, except *LOOKUP which takes a long time.
    Specific Example is below:
    I have a piece of script that successfully splits JV Expense by customers. A Profit Share planning driver determines the percentage that each customer is entitled to. Typically this will be 100%, but could be 50% between two customers.
    The PROFIT SHARE planning drivers records, and PARTNER_INCOME transactional records are below:
    ACCOUNT
    ENTITY
    PARTNER
    SIGNED DATA
    PROFIT_SHARE
    UK_001
    PARTNER_A
    0.5
    PROFIT_SHARE
    UK_001
    PARTNER_B
    0.5
    PROFIT_SHARE
    UK_002_PLANNING_DRIVERS
    PARTNER_B
    1.00
    PARTNER_INCOME
    UK_001
    NO_PARTNER
    $5,000
    PARTNER_INCOME
    UK_002
    NO_PARTNER
    $5,000
    UK_001 has two partners that are each entitled to 50% of the $5,000 NET PROFIT.
    For UK_002, one one single Partner is entitled to 100% of the $5,000 NET PROFIT.
    Using script logic, you can scope the Profit Share account (PROFIT_SHARE) - , and use a *REC statement to multiply this by the driver. It would look like:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *REC (EXPRESSION = %VALUE% * ([ACCOUNT].[PROFIT_SHARE],[PARTNER].[NO_PARTNER]), ACCOUNT = PARTNER_PROFIT_SHARE)
    *ENDWHEN
    This wouldn't be a problem if the Planning Driver is always stored on the same Entity that the Income is stored on, but for UK_002, the planning driver is stored on another Entity - which is stored in a the PLAN_DRIVER_REF property of the entity. It should use UK_002_PLAN_DRIVERS
    ID (Entity)
    PLAN_DRIVER_REF
    UK_001
    UK_002
    UK_002_PLAN_DRIVERS
    UK_002_PLANNING_DRIVERS
    In this scenario, we need to switch out the Entity used in the MDX, however I do not believe you can use a property in MDX - can anyone confirm?
    I have currently implemented the *LOOKUP functionality to loop through, changing each *LOOKUP partner for each loop.
    Lookup:
    *LOOKUP PLANNING_JV_US
    *FOR %LOOP_ASLS% = %ASL_LOOKUP_LOOP_VARIABLE%        
      *DIM LOOK_%LOOP_PARTNERS%:ACCOUNT = "PROFIT_SHARE"
      *DIM LOOK_%LOOP_PARTNERS%:PARTNER= %LOOP_PARTNERS%
    *NEXT
    *DIM ENTITY = ENTITY.PLAN_DRIVER_REF                   //   Use PLAN_DRIVER_REF Property of Entity
    *ENDLOOKUP
    Scope and *REC:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *FOR %LOOP_PARTNERS% = %PARTNER_LOOKUP_LOOP_VARIABLE%      // 1000 Partners
    *REC(EXPRESSION = %VALUE% * LOOKUP(LOOK_%LOOP_PARTNERS%), PARTNER= %LOOP_PARTNERS%, ACCOUNT = TCOJVSHAR_CALC, AUDIT_ID = PP_EXPENSE_BY_PARTNER)
    *NEXT
    *ENDWHEN
    The problem with the above, is that because the Lookup is being generated for every single Partner, there are significant numbers of loops.
    Does anyone know of another way this can be implemented in Script Logic? Otherwise we'll need to explore BAdI route.
    Thanks,
    Nick

    Hi Nick,
    Use property in LOOKUP - will dramatically speed up the calculation without FOR/NEXT.
    Vadim

  • Greater Than Function in Script Logic File

    BPC Experts,
    I've got a pretty simple script logic file to calculate salary amounts, overtime, etc.  The purpose of this logic is for forecasting.  I have two referenced dimensions, TIME and SCENARIO, where TIME.MONTHNUM is equal to its relative month number (eg: Jan monthnum = 1), and SCENARIO.CURRMONTH is equal to the relative amount of actual months data, (eg Jan currmonth = 0, Feb = 1) because if you are completing a February forecast, you have one month of actual.
    The ACTUAL scenario is never touched, but after a month closes, we copy the ACTUAL data to, for example, FEB_FCST.  So, after January closes, its actuals are copied to the FEB_FCST scenario so we can complete an actual/forecast (one month actual, 11 months forecast).
    Currently, the default logic skips anything in the ACTUAL scenario, by stating "*WHEN SCENARIO, *IS <> "ACTUAL" yada yada yada.
    However, when the default logic runs on the forecast scenarios, it takes the same inputs from the months that are copied over from the ACTUAL scenario and adds to the original amount, essentially doubling the value--ultimately causing an incorrect actuals number in the forecast scenario.
    My script right now looks like this:
    *XDIM_MEMBERSET DATASRC=INPUT
    *XDIM_MEMBERSET PRODUCT=NO_PRODUCT
    *XDIM_MEMBERSET SHIFT=NO_SHIFTS
    *XDIM_MEMBERSET MEASURES=PERIODIC
    *WHEN SCENARIO
    *IS <> "ACTUAL"
         *WHEN TIME.MONTHNUM
         *IS > SCENARIO.CURRENTMNTH
              *WHEN ACCOUNT
              *IS "SALARIED_MANPOWER"
                   *REC(EXPRESSION=((([ACCOUNT].[SALARIED_AVG_WAGE] * (1 + [ACCOUNT].[SALARY_TIMEAHALF]))* [ACCOUNT].[SALARIED_MANPOWER])),ACCOUNT="01100")
              *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    When it hits line 9 (*IS > SCENARIO.CURRENTMNTH) during validation, it errors.  How can I use a "greater than" function to dictate whether or not a given scenario should run default logic on a specific month?
    If not, is there a different/better way to do it?
    Thank you!
    ABF

    Hi Alex
    Take this sample logic, check the properties in your Time dimension to trouble shoot your issue.
    *SELECT(%CAT_VAR%, "ID", CATEGORY, ID= PLAN_APRIL)
    *XDIM_MEMBERSET CATEGORY = ACTUAL, PLAN, %CAT_VAR%
    *SELECT(%CATMTH%, "STARTMTH", CATEGORY, ID= %CAT_VAR%)
    *SELECT(%ACT_PERIOD%, "ID", TIME, MONTHNUM < %CATMTH% AND  LEVEL = MONTH AND YEAR = 2010)
    *SELECT(%PLAN_PERIOD%, "ID", TIME, MONTHNUM >= %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)
    *XDIM_MEMBERSET TIME= %ACT_PERIOD%
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *WHEN CATEGORY
    *IS ACTUAL
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    *XDIM_MEMBERSET TIME= %PLAN_PERIOD%
    *XDIM_MEMBERSET CATEGORY=PLAN
    *WHEN CATEGORY
    *IS PLAN
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    Thanks

  • SQL functions in Script Logic

    I want to build a script logic but the dimensions that I am testing do not have the fields I want in the format I want. In my case I would like to test the "Start" property in the Employee dimension. The property represents the employee start date but is a var char in the format dd.mm.yyyy rather thna a date field. I want to test whether it is five years prior to the date being processed.
    My time dimension has a year property and a monthnum property. Each of these are varchar. I can write SQL that would convert these to a date and compare them with the start property on the employee dimension.
    Can I  do iinsert SQL functions in the When statement. An example would be
    *When convert(datetime, substring(employee.start,4,2) + '/' + substring(employee.start,1,2) + '/' + substring(employee.start,7,4))
    Can I use  SQL functions in the Is statement? An example would be
    *Is <DateAdd(YY,-5 , convert(datetime, Time.Monthnum + '/01/'' + time.year)
    Finally when I use such techniques and look at the log by using "show log" in the logic debugger I see no reference to the SQL I used. It is as if the generated SQL has not made use of my functions. Instead all I seee are the extract statements from the three fact tables. Is this normal? Is there a way to see what SQL is really being generated and run?
    At the moment it seems my only option is to make changes, try running it and hope I get an output. If no records are written I can't be sure whether it is because embedding SQL function is not supported or because I have made some other error.

    No, the "BPC SQL" script logic doesn't allow for this extensive use of real SQL within the scripting syntax. As a concept, it's best to think of "BPC SQL" script logic as, "this unique BPC logic syntax will generate real SQL code when it's executed."
    There's very little real SQL that you can use within the syntax itself, and definitely not within the WHEN or IF statements.  Nothing like cast, convert, substring, etc. (Except you CAN use these, a little bit, in a *SELECT statement. But I don't see how that will solve your current problem.)
    Plus, when you consider how the logic engine processes a set of data, it's helpful to think of it in terms of selects & reading through a recordset. So in that regard, a SQL background can be helpful, in understanding the concepts. (Sort of helpful, except when it confuses you, or frustrates you since you don't have all the power you want.)
    Anyway, to solve your problem, you might be able to restate the problem, and then use something like this code, which is valid syntax:
    *WHEN TIME.TIMEID
    *IS >= VERSION.FirstPlanMonthTimeID
    In this case, FirstPlanMonthTimeID is set up in the version dimension as, for example, 20090400 (representing 2009.APR). This timeID is set by BPC automatically when processing the time dimension, and I need to ensure that my Version property value is set to match it.
    A key point is that in BPC fact tables, the time dimension is stored as TIMEID (not ID, unlike all the other dimensions), and can be used for comparative evaluation in script logic WHEN/IF. The comparison property needs to be stored as an 8-digit integer value. If your time dimension has days in it (along with months), check the TIMEID after processing, and you should see the pattern for assigning values to TIMEID for days and months, etc.
    Normally, TIMEID is assigned pretty sensible and stable values. If it doesn't meet your logic requirements, you can create another property (be careful of USERTIMEID, since that has a specific purpose in the system which I've never fully understood) and assign that whatever (integer) values make sense.

Maybe you are looking for

  • Early Watch Session overdue - Error in Data Transfer

    Hi folks, in my solution, the Early Watch Reports from the productive system are labeled overdue (with a red flag). It says that there is no data transmitted from SDCC. When calling SDCC manually, it says that I don't have the necessary authorisation

  • IDOC to File Scenario - Configuration steps need to be done in R3 and XI

    Hi Experts, I am working with IDoc to File scenario. Can someone please explain, what are the steps or configuration things need to be done in R3 and as well as in XI too. Thanks in advance. Regards, Sree

  • Multiple Series Cluster Barchart locks up HTMLDB_PUBLIC_USER DB sessions

    I am trying out cluster barcharts. I had a cluster barchart with two series. If I have no ORDER BY clause on the SELECT statements, the chart displays, but the bars are not clustered together correctly. I want all the bars from series #1 together and

  • Finder fails to list shared drives by clicking sidebar

    I have a strange problem that is persistent and although not always repeatable, happens very often, and by that I mean several times a day. The problem was also there with Leopard, and I'd hoped Snow Leopard and it's subsequent updates might fix thin

  • 100% Noob - Basic configuration of a 1941W?

    Just received a Cisco 1941W-A/K9 and was told to configure it.  I'm looking for a setup document/tutorial that will help me walkthru an initial configuration?  It's been a while since I've had to configure a Cisco device.