Planning Analytics

 View Only
  • 1.  Max function syntax error

    Posted Wed November 16, 2022 12:02 PM
    Hi, 

    I was wondering if someone could help me. 

    I'm trying to utilize the max function to determine the maximum value between:

    0.5 * ((1 - DB('6_Statutory Adjustments','Live Data',!Stat_Entity Consolidation,!Stat_Forecast Period,'2022 Commission Adjustment','Value') - 0.0075) * (['Live Data','Premiums','Value']*-1) - ['Live Data','Claims and Reserves','Value']) and 0.

    I have built the following rule, but encountering a syntax error - wondering if anyone would be able to assist me? 

    #['Live Data','Commission','Value']=C: ((DB('6_Statutory Adjustments','Live Data',!Stat_Entity Consolidation,!Stat_Forecast Period,'2022 Commission Adjustment','Value')*-1) * (['Live Data','Premiums','Value']))+ MAX(0.5 * ((1 - DB('6_Statutory Adjustments','Live Data',!Stat_Entity Consolidation,!Stat_Forecast Period,'2022 Commission Adjustment','Value') - 0.0075) * (['Live Data','Premiums','Value']*-1) - ['Live Data','Claims and Reserves','Value']),0);

    Thanks in advance,
    Kane

    ------------------------------
    Kane Henderson
    ------------------------------

    #PlanningAnalyticswithWatson


  • 2.  RE: Max function syntax error

    Posted Wed November 16, 2022 06:44 PM

    I strongly recommend you break your rule code over several lines eg:

    ['Live Data','Commission','Value']=C: 
    (
    	(
    		DB('6_Statutory Adjustments',
    		'Live Data',
    		!Stat_Entity Consolidation,
    		!Stat_Forecast Period,
    		'2022 Commission Adjustment',
    		'Value')*-1
    	) * (
    ['Live Data','Premiums','Value'])
    ) + 
    MAX(0.5 * (
    (1 - DB(
    	'6_Statutory Adjustments',
    	'Live Data',
    	!Stat_Entity Consolidation,
    	!Stat_Forecast Period,
    	'2022 Commission Adjustment',
    	'Value')
    	 - 0.0075) * 
    	(['Live Data','Premiums','Value']*-1) - 
    	['Live Data','Claims and Reserves','Value']
    	),0);​

    Looking at the result I think your bracket matching near the end looks wrong.



    ------------------------------
    David Usherwood
    ------------------------------