Forum Discussion

VictoriaLaw's avatar
VictoriaLaw
Qrew Trainee
5 years ago

Formula - Rich Text code displaying on dynamic filter

Hello! I'm a beginner to QB. I've searched high and low in the community posts for a similar question and haven't come across any.

I wrote a rich text formula to evaluate if a date is before or after today's date and mark the status "Active" and green or "Inactive" and gray. It works beautifully except the code to change the colors is being displayed in the dynamic filter. Ideally it would only display "Active" or "Inactive". If anyone can review my formula and help me fix it, it would be appreciated!

If([Term End] > Today(),"<div style=\"color:green;\">Active</div>", "<div style=\"color:gray;\">Inactive</div>")





2 Replies

  • Right, so DFs will not render in HTML.  I suggest you make two fields.

    The Status field would be formula text.

    If([Term End] > Today(),"Active", "Inactive")

    The [Status colored] field or perhaps named [Status.] if you want to be sneaky and have a short name for reports would be a Rich text formula field 

    Case([Status],
    "Active",   "<div style=\"color:green;\">Active</div>",
    "Inactive", "<div style=\"color:gray;\">Inactive</div>")

    The use the [Status] field as the DF and the [Status.] field on the report.


    • VictoriaLaw's avatar
      VictoriaLaw
      Qrew Trainee
      This worked a treat and seems so simple now. Thanks for your help!