calculated field - if value starts with .. select this: SOLVED

Hi,

i have a question about calculated fields.

Use Case is: We'd like to cluster living-areas. 

Therefore i need something like a calculated field thats selects for example Reagion1 if the zipcode in the linked field/module starts with 3.

Thanks!

Parents Reply
  • Hey, 

    thanks for the reply.

    So i tried it and i use the following formular

    ifElse(
    isWithinRange(rollupSum($zipcode_short_c,"amount"),01,09),
    "Sachsen",
    ifElse(
    isWithinRange(rollupSum($zipcode_short_c,"amount"),10,19),
    "Brandenburg",
    ifElse(
    isWithinRange(rollupSum($zipcode_short_c,"amount"),20,29),
    "Hamburg",
    ifElse(
    greaterThan(rollupSum($zipcode_short_c,"amount"),30),
    "keine Region",
    "0"
    )
    )
    )
    )

    But there is a error:

    Ungültige Formel 
    "Unexpected token I in JSON at position 0"

    Any suggestions?


    Thanks!

Children
  • I got this working formula in my dev instance:

    ifElse(
    isWithinRange(rollupSum($opportunities, "amount"), 1 ,9),
    "Sachsen",
    ifElse(
    isWithinRange(rollupSum($opportunities, "amount"), 10, 19),
    "Brandenburg",
    ifElse(
    isWithinRange(rollupSum($opportunities, "amount"), 20, 29),
    "Hamburg",
    ifElse(
    greaterThan(rollupSum($opportunities, "amount"), 30),
    "keine Region",
    "0"
    )
    )
    )
    )

    You just need to replace the link name at the rollupSum formula.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada