Forum Discussion

DaleMiller's avatar
DaleMiller
Qrew Member
4 years ago

Attempting to filter in Dynamic Rules Setting.

Hello, 

I am in the Dynamic Rules setting, and I am trying to set it up where if I have the user supply the last date of an incident, that Quickbase will go back 6 months, and another rule for 12 months to see if we have another incident on file. 

For example, if I am doing an assessment today, and on my form I say the last incident was 3/15/2020, I want Quickbase to identify that the March date is within the past 6 months. If it is, then I want it to show something else on the form. If the user puts  1/15/2020 (which is over 6 months ago), for the quickbase to not show something else on the form. 

Hopefully I am explaining it correctly. 

I am also not sure what the + box is on the dynamic rule. Such as in the rule setting, "is on or before" "the current date" "+[  ]".   What does the + box do?

------------------------------
Dale Miller
------------------------------

1 Reply

  • The easiest way to handle this kind of thing is to first create some formula checkbox fields (IsWithinLast6Months and IsWithinLast12Months) for your conditions. If you are always anchoring to the current date, the formula fields would look something like this:

    IsWithinLast6Months:

    If( Length(ToText([Last Incident])) > 0 and
        [Last Incident] <= Today() and
        ToDays(Today() - [Last Incident]) <= 183,
        true,
        false
    )


    IsWithinLast12Months:

    If( Length(ToText([Last Incident])) > 0 and
        [Last Incident] <= Today() and
        ToDays(Today() - [Last Incident]) <= 365,
        true,
        false
    )

    Once you have these fields created, use them within your form rules to drive your display/hide logic for other stuff (fields or sections) on the form.

    Regards,
    Michael