View Only

Yes - You can colourize Summary Report Cells

  • 1.  Yes - You can colourize Summary Report Cells

    Posted 01-26-2023 12:49
    I was working with a client who was working with Ryan Murray of Quickbase and their need was to colour the cells in a summary report.  To my surprise, this is indeed possible.

    I checked in with @Sharon Faust to see if this was known to the community at large and she agreed that it was news to us. Sharon might do a video on this, we hope ...  but meanwhile here we go...... 

    Sharon took Ryan's example code that I was able to obtain and simplified it to this.

    This would be the formula for a "Summary Formula" called say Highlighted Issue Count

    var text STYLE = "style='display:block; padding:5px; width:40px; color:white; text-align:center; background:";
    var text red = "<span " & $STYLE & "red;'>" & [number of issues] & "</span>";
    var text green = "<span " & $STYLE & "green;'>" & [number of issues] & "</span>";
    var text yellow = "<span " & $STYLE & "gold;'>" & [number of issues] & "</span>";
    var text gray = "<span " & $STYLE & "gray;'>" & [number of issues] & "</span>";

    If([number of issues]=0,$gray,
    [number of issues]<.25,$green,
    [number of issues]<=.30,$yellow,$red)

    In the code above the "field" called [number of issues] is in fact a "Summary Variable" as part of the Summary Report builder panel.

    Then the magic is to have the report Summarize the Summary Formula field for Highlighted Issue Count.  That does not seem to be intuitive to us, as we are used to only being able to summary numeric fields, but in fact it works.

    The result might look like this for different use cases.

    or this

    In this example the normal range for a medical test result is shown (which is another Summary Formula text!) and the result is in red if the result was outside the normal bounds.  You see that the top MCAS value of 787 is considered normal as its between 0-1802, but the Endocrine is out of range.

    Mark Shnier (Your Quickbase Coach)