Forum Discussion

EddyElasmar's avatar
EddyElasmar
Qrew Member
2 years ago

KanBan Color Coding Based on a date passed

Oh man do I need some help... I have a kanban that i am trying to color code based on a due date that has passed. So I have a status field and when that status changes to for example "Status 1", a dynamic form rule logs in the date in another field... based on that date, within 2 days, green. 4 days, yellow. so on, red.... BUT WHEN STATUS CHANGES to "Status 2" it logs in the date in a different field and the same concept applies. So I want the ticket colors to change based on how long a status has not been changes. Maybe I could change it so whenever status changes, it logs a new date in the same field. I am pretty lost and could use some help! Thank You in advance

------------------------------
Eddy Elasmar
------------------------------

9 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    Sure we can help.  Can you state very clearly  and as concisely as possible as to the names of these date fields and what the logic should be for the colours?


    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • EddyElasmar's avatar
      EddyElasmar
      Qrew Member
      Shop Status is a drop down field which contains:
      In Queue
      Pulling
      Cutting
      Milling
      Sealing
      Building/Boxing
      Complete & Ready to Ship

      When a project is "In Queue" - KanBan ticket is green always

      When a project is "Pulling" - Kanban ticket is green for the first 24 hours, yellow for the next 48, red after that

      When a project is "Cutting", "Milling", "Sealing", & "Building/Boxing" - Kanban ticket is green for the first 48 hours, yellow for next 48 hours, red after 96 hours.

      "ready to ship" green


      so basically each time that [Shop Status] Field changes, the timer needs to reset. Weather that could all be encoded or I need fields around that like i have currently a dynamic form rule to fill in a different field the date once [Shop Status]="Pulling"

      (Named those date fields: [Pulling Date Snapshot on Shop Status Change] - I know they're not technically snapshot fields... just dynamic form rules)









      This is what I have which is wrong and not much.
      Case([Shop Status],"In Queue","#23ff00",
      Case([Shop Status],"Pulling","#23ff00",
      Case([Shop Status],"Complete & Ready to Ship","#23ff00",
      if([Shop Status]="Pulling" & ([Pulling Date Snapshot on Shop Status Change] -today() >hours(0) & ([Pulling Date Snapshot on Shop Status Change] -today() >hours(48),
      "<div style=\"color:white;background-color:#9B0909;\">" & due: "&[Pulling Date Snapshot on Shop Status Change]" ))))

      ------------------------------
      Eddy Elasmar
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew #1 Challenger
        One way to capture the date and time of the status change the status field's Properties to "Log Changes", and also to set it to log the time as well.

        I suggest renaming the field to be called [Status Update].
        Then make two new fields.

        [Status] as a formula text field:
        Trim(Right([Status Update],"]"))

        and [Status Date/ Time] as a formula Date / Time  field:

        var text DateAndTime = Left(Right([Status Update],"["),18);
        var date TheDate = ToDate(Left($DateAndTime," "));
        var timeofday TheTime = ToTimeOfDay(NotLeft($DateAndTime,9));
        ToTimestamp ($TheDate, $TheTime)

        OK, so now you have a clean field for the Status and a clean date time field for the date and time of the most recent status change. 

        Let's now do a new formula numeric field for the [# Hours in Status]

        ToHours(Now() - [Status Date/ Time])


        Now we can do the formula for the color.  I suggest making this a formula field too, called [Kanban Color]  so you can easily see what's in it.

        //When a project is "In Queue" - KanBan ticket is green always
        IF(
        [Status] = "In Queue", "Green",

        //When a project is "Pulling" - Kanban ticket is green for the first 24 hours, yellow for the next 48, red after that

        [Status]= "Pulling" and [# Hours in Status] <=24, "green",
        [Status]= "Pulling" and [# Hours in Status] <=48, "yellow",
        [Status]= "Pulling" and [# Hours in Status] >48, "red",

        //When a project is "Cutting", "Milling", "Sealing", & "Building/Boxing" - Kanban ticket is green for the first 48 hours, yellow for next 48 hours, red after 96 hours.

        Contains("Cutting Milling Sealing Building/Boxing", [Status])
        and [Status]<>""
        and  [# Hours in Status] <=48, "green",

        Contains("Cutting Milling Sealing Building/Boxing", [Status])
        and [Status]<>""
        and [# Hours in Status] <=96, "yellow",

        Contains("Cutting Milling Sealing Building/Boxing", [Status])
        and [Status]<>""
        and [# Hours in Status] >96, "red",


        //"ready to ship" green

        [Status] = "Complete & Ready to Ship", "green")

        All done, so now just set the Kanban colorization formula in the report to be [Kanban Color].  You cam also then conveniently use the same formula for row colorization on a regular table Report.  





         


        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------