No open parentheses error on formula

Hi

If anyone could help it would be greatly appreciated. 

I need to add an element to my working formula below (by working formula i mean it is already in place and working as i would like but have a new requirement that i need to add in)

What the formula currently does: If 'total paid' is greater than 0, put this field as 0. If not, if the net value is greater than £50,000 then this field should be £6,000, if not this field should be 10% of gross value

Working formula: 

ifElse(
greaterThan(
$pr_total_paid_c,
0
),
"0",
ifElse(
greaterThan(
number(
$pr_net_value_c
),
50000
),
add(
5000,
multiply(
5000,
divide(
$pr_payment_rate_c,
100
)
)
),
multiply(
$pr_payment_gross_value_c,
.1
)
)
)

What i need to add: If Project type is equal to "Supply and Fit" or "Supply and Fit 2023" and net value is greater than £50k ...

New formula (i have added this below in yellow but am getting 'no open parentheses' error)

ifElse(

greaterThan(

$pr_total_paid_c,

0

),

"0",

ifElse(

(equal($pr_project_type_c,"Supply and Fit"),equal($pr_project_type_c,"Supply and Fit 2023")

and(

greaterThan(

number(

$pr_net_value_c

),

50000

),

add(

5000,

multiply(

5000,

divide(

$pr_payment_rate_c,

100

)

)

)

)

),

multiply(

$pr_payment_gross_value_c,

.1

)

)

)

if anyone has any suggestions of what i may have missed or what i can do to fix this, please let me know! 

Thanking you in advance

Parents
  • Hi ,
    If I understood your requirement, you are looking something like this. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ifElse(
    greaterThan(
    $pr_total_paid_c,
    0
    ),
    "0",
    ifElse(
    and(
    or(
    equal($pr_project_type_c, "Supply and Fit"),
    equal($pr_project_type_c, "Supply and Fit 2023")
    ),
    greaterThan(
    number($pr_net_value_c),
    50000
    )
    ),
    add(
    5000,
    multiply(
    5000,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    PS: Its recommend to use Insert menu to use code feature for better code transfer. 

    Let me know if this works. 

    Tevfik Tümer
    Sr. Developer Support Engineer

  • Thank you so much! This has worked Slight smile
    How do I use Insert menu to use code feature sorry?

  • I'm glad it worked. :) 

    When you are typing your messages in this editor there is a menu (Edit | Insert | Format | ...) 
    Using Insert > Code you can paste your code. Then it would look like the code in my answer. 

    Hope it helps for your further questions. 

    Tevfik Tümer
    Sr. Developer Support Engineer 

Reply
  • I'm glad it worked. :) 

    When you are typing your messages in this editor there is a menu (Edit | Insert | Format | ...) 
    Using Insert > Code you can paste your code. Then it would look like the code in my answer. 

    Hope it helps for your further questions. 

    Tevfik Tümer
    Sr. Developer Support Engineer 

Children
No Data