Discussions

Expand all | Collapse all

Formula Help

  • 1.  Formula Help

    Posted 01-18-2018 21:16
    I'm attempting to create a series of colorized progress trackers, based on a number of requirements.  To do so, I'm trying to colorize a field based on a number of checkboxes.  

    Example:

    I have different types of contacts that I need my sales folks to ensure we have in place prior to moving a deal forward.  What I would like is for the status bar on the main page to change color based on having none of the boxes checked (Red), any one of the boxes checked (Orange), and two boxes checked (Yellow) and all boxes checked (Green).

    Thoughts?

    Mike


  • 2.  RE: Formula Help

    Posted 01-18-2018 21:26
    There are 502 icons here available for public use in 5 convenient sizes.

    https://login.quickbase.com/db/9kaw8phg?a=ShowPage&pageid=134

    https://login.quickbase.com/db/bcgnn27bx?a=q&qid=1000039

    var number NumCompleted =
    Count( [checkbox 1], [checkbox 2],[checkbox 3]);

    Case($Count,
    0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>",
    1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>",
    2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>",
    3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")


  • 3.  RE: Formula Help

    Posted 01-18-2018 22:36
    Ok, So I probably should've started with, I kinda suck at formulas.  I've put what you showed above into my field, changed the "[checkbox 1] to the actual name of the field, and I'm getting the following error.  
    Sorry to be a hassle.

    Mike

    *NOTE*
    I'm going to need to replicate this across a couple of different tables that are not only related to contacts.

    --------------------------------------------------------------------------------------------------------------------------------------

    var number NumCompleted = Count([Buyer], [Decision Maker],[Influencer]);Case($Count,0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>";, 1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>";, 2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>";, 3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")

    Error message:

    Formula Error--Undeclared Identifier
    The variable Count is not declared


  • 4.  RE: Formula Help

    Posted 01-18-2018 22:38
    No problem, there was a clear error in my formula
    Change that first part to this

    var number Count NumCompleted = 
    Count( [checkbox 1], [checkbox 2],[checkbox 3]);


  • 5.  RE: Formula Help

    Posted 01-22-2018 15:09
    I apologize for being a pain (and for not understanding formulas better at this point), but I'm still getting an error message.  

    Immediately below is the error message.  Below that, is exactly what I have placed in the formula box.

    Thanks again for all the help.

    Mike

    Error Message
    _______________________________

    A variable declaration must have an assignment operator.


    var number Count   NumCompleted = Count([Buyer], [Decision Maker],[Influencer]);Case($Count,0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>";, 1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>";, 2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>";, 3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")

    In my Formula Box
    ________________________________

    var number Count NumCompleted = Count([Buyer], [Decision Maker],[Influencer]);Case($Count,0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>";, 1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>";, 2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>";, 3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")


  • 6.  RE: Formula Help



  • 7.  RE: Formula Help

    Posted 01-22-2018 15:31
    Same error message.


  • 8.  RE: Formula Help

    Posted 01-22-2018 15:32
    Sorry my mistake
    Chance the first line to this

    var number Count  = Count([Buyer], [Decision Maker],[Influencer]);


  • 9.  RE: Formula Help

    Posted 01-22-2018 18:51
    Perfect.  Now we're getting somewhere.  However, the record only displays the URL as opposed to the icon.
    Thoughts?

    Mike


  • 10.  RE: Formula Help

    Posted 01-22-2018 18:57
    The field type is probably Formula text.
    Can you carefully change it to formula Rich text.  make sure you choose formula Rich text and not Rich Text.


  • 11.  RE: Formula Help

    Posted 01-22-2018 19:04
    And now I feel like an idiot.  Lol.  
    Thanks for all the help on this.  I owe you a drink at Empower.

    Mike


  • 12.  RE: Formula Help

    Posted 01-22-2018 19:05
    :) I will be there ....  That field type is a new thing. it used to be a checkbox to enable html on a regular  formula field, but that changed in the December release to a separate field type.