Discussions

 View Only
Expand all | Collapse all

Help with color coding report

  • 1.  Help with color coding report

    Posted 03-27-2018 15:20
    Code:
    Case([Contact Type], "No Longer with Firm", "#82BE41",
    "Terminated Client", "#FFA07A",
    "No Longer on the Engagement", "#E1EED9",
    "Not a Current Client", "#42BCE8", "")


    Error received:
    Formula error -- Bad or missing arguments in function call

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function Case.

    The function is defined to be Case ( x, val1,result1, ..., else-result).

    You may need to do one of the following to fix the problem:
    • Choose the right number and type of arguments.
    • Use a type conversion function to convert the arguments you are using to the correct type.
    • Choose a different function


  • 2.  RE: Help with color coding report

    Posted 03-27-2018 16:12
    Can you tell us what field type is [Contact Type]

    Maybe it is a multi-select field?


  • 3.  RE: Help with color coding report

    Posted 03-27-2018 20:28
    Yes it is a multi select text

    Mark


  • 4.  RE: Help with color coding report

    Posted 03-27-2018 20:31
    Try this
    var text ContactTypeInTextFormat = ToText([Contact Type]);

    IF(
    Contains($ContactTypeInTextFormat, "No Longer with Firm"), "#82BE41",
    Contains($ContactTypeInTextFormat,"Terminated Client"), "#FFA07A",
    Contains($ContactTypeInTextFormat,"No Longer on the Engagement"), "#E1EED9",
    Contains($ContactTypeInTextFormat,"Not a Current Client", "#42BCE8"))


  • 5.  RE: Help with color coding report

    Posted 03-27-2018 20:32
    Note that since more than 1 value can selected, the first one which is true will "win".


  • 6.  RE: Help with color coding report

    Posted 03-27-2018 20:34
    It gave me this error...

    Formula error -- Bad or missing arguments in function call

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function Contains.

    The function is defined to be Contains (Text u, Text v).

    You may need to do one of the following to fix the problem:
    • Choose the right number and type of arguments.
    • Use a type conversion function to convert the arguments you are using to the correct type.
    • Choose a different function.


  • 7.  RE: Help with color coding report

    Posted 03-27-2018 20:41
    Hmmm, and you exactly pasted in the formula above?  Can I see your exact formula? 


  • 8.  RE: Help with color coding report

    Posted 03-27-2018 20:47
    var text ContactTypeInTextFormat = ToText([Contact Type]);

    If(
    Contains($ContactTypeInTextFormat, "No Longer with Firm"), "#82BE41",
    Contains($ContactTypeInTextFormat,"Terminated Client"), "#FFA07A",
    Contains($ContactTypeInTextFormat,"No Longer on the Engagement"), "#E1EED9",
    Contains($ContactTypeInTextFormat,"Not a Current Client", "#42BCE8"))


  • 9.  RE: Help with color coding report

    Posted 03-27-2018 20:55
    I got it!  Thanks just needed to move a )


  • 10.  RE: Help with color coding report

    Posted 03-27-2018 21:00
    OK, I see my error now n the last line.

    Contains($ContactTypeInTextFormat,"Not a Current Client"), "#42BCE8")


  • 11.  RE: Help with color coding report

    Posted 03-27-2018 18:25
    The Case statement doesn't need the final clause - this is all you need to do:
    Case([Contact Type], "No Longer with Firm", "#82BE41",
    "Terminated Client", "#FFA07A",
    "No Longer on the Engagement", "#E1EED9",
    "Not a Current Client", "#42BCE8")


  • 12.  RE: Help with color coding report

    Posted 03-27-2018 20:29
    It gave this error, probably because Contact Type is a multi select text...

    Formula error -- Bad or missing arguments in function call

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function Case.

    The function is defined to be Case ( x, val1,result1, ..., else-result).

    You may need to do one of the following to fix the problem:
    • Choose the right number and type of arguments.
    • Use a type conversion function to convert the arguments you are using to the correct type.
    • Choose a different function.