Forum Discussion

AndrewWilber's avatar
AndrewWilber
Qrew Trainee
4 years ago

Multiple If Statements in conditional formatting

Hello!

I am doing a conditional formatting field which I am calling "Visual status".  I am using this field to alert me to key issues with records in my system visually.

I have developed the following code:

var text red = "<img src=https://images.quickbase.com/si/24/221-point_red.png>";
var text yellow = "<img src=https://images.quickbase.com/si/24/223-point_yellow.png>";
var text green = "<img src=https://images.quickbase.com/si/24/222-point_green.png>";



If(
[Required BOM Release Date]<Today(),$red, Today()-Days(10) < [BOM Yellow Date] ,$yellow
)



What I am looking to do now is add a multiple If statement that looks at 1 more field.  The new field I have added is [BOM Release Date].  This is the actual BOM release date.  What I am trying to figure out is to take into account the actual BOM release date so that my current formula won't turn yellow or red once I get closer to "Today()".  The way my current formula is written once my Required BOM Release Date approaches, the record turns red regardless if my team put a BOM in place or not.


Thank you for your assistance!


Andrew

------------------------------
Andrew Andrew
------------------------------

4 Replies

  • Can you say in words what do you want the logic to be for your formula. If you can see it we can help you with the formula.  You were kind of vague about the date getting close.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • AndrewWilber's avatar
      AndrewWilber
      Qrew Trainee
      Thanks for asking for clarification - this is what I was thinking.  

      If BOM Release Date is before Required BOM release date --> Green
      IF BOM Release date is after required BOM release date --> Red
      IF BOM release date is empty and Required BOM release date < Today () --> Red
      IF BOM release date is empty and Today()-Days(10) < [BOM Yellow Date] ,--> yellow




      ------------------------------
      Andrew Andrew
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        If(
        [BOM Release Date] <   [Required BOM release date], $green,
        [BOM Release date]  >  [required BOM release date], $red,
        Isnull([BOM release date]) and [Required BOM release date] < Today (), $red,
        Isnull([BOM release date]) and Today()-Days(10) < [BOM Yellow Date] ,$yellow)

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
  • DonLarson's avatar
    DonLarson
    Qrew Commander
    Andrew,

    This could get complicated based upon the order that you want something to happen.  If you flow chart it first, then it is easier to build the If Statements.  However if your Bill of Materials is released this might solve your issue:

    If (  [BOM Release Date]<>"", $green,
          [Required BOM Release Date]<Today(),$red,
          Today()-Days(10) < [BOM Yellow Date] ,$yellow, "")

    If Operations has released the BOM you will be Green even if it was late.  The last part might not be acceptable for your business logic.


    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------