Formula Help: Is This Possible?

Please help with this formula for a filter (if this is possible).

I have two date fields, startdate and enddate.

For the filter I would like to use:

Include this row when:

If the field enddate is populated and its value is greater than today.
If the field enddate is not populated, then if the field startdate is greater than today.

I’m having a little trouble getting my head around this, but Coda has quickly became my go to app!

Thanks for any help!

1 Like

Hi @Chris_Hall :blush:

Is this what you were looking for ? :blush:

(thisRow.enddate.IsNotBlank() AND thisRow.enddate > Today()) 
OR 
(thisRow.enddate.IsBlank() AND thisRow.startdate > Today())

Edit : The explanations are :point_right: here :innocent:

2 Likes

Yes!

Thank you!!!

I think I’m beginning to understand formula a little better now!

1 Like

That’s great to read :raised_hands: !
And you seemed already really pretty close to make it work by saying this :point_down: @Chris_Hall :raised_hands:

If I decompose your sentences, this is what I read (and how I ended up with the formula) :blush: :

Step 1 of the filter:

If the field enddate is populated and its value is greater than today.
  • the field enddate is populatedthisRow.enddate.IsNotBlank()

    AND

  • its value is greater than todaythisRow.enddate > Today()

OR

Step 2 of the filter:

the field enddate is not populated, 
then if the field startdate is greater than today.
  • field enddate is not populatedthisRow.enddate.IsBlank()

    AND

  • the field startdate is greater than todaythisRow.startdate > Today()

And the whole filter works like this :blush: :

  • Step 1 will return True and keep the rows where both conditions thisRow.enddate.IsNotBlank() AND thisRow.enddate > Today() are True

  • Step 2 will return True and keep the rows where both conditions thisRow.enddate.IsBlank() AND thisRow.startdate > Today() are True

The whole filter will return True and keep the rows in the table for which either Step 1 OR Step 2 has returned True :blush:

2 Likes

How did you get all that cool button like formatting on your response???

2 Likes

Hehe :joy:

I used the <kbd> HTML Tag :blush:
(which is the tag used generally to display keys from a keyboard where one would think it’s needed… mostly on GitHub :blush: … At least, that’s where I found it)

  • <kbd>⌘ Cmd</kbd> + <kbd>c</kbd>

    ⌘ Cmd + c

  • <kbd>⌘ Cmd</kbd> + <kbd>⇧ Shift</kbd> + <kbd>v</kbd>

    ⌘ Cmd + ⇧ Shift + v

4 Likes

Today I learned :smiley:

To meet the 20 character rule, wondering if <blink> tag would work. blink (edit: nope)

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.