Skip to main content
andreammelde
Helper ⭐️⭐️
May 11, 2021
New Idea

Case Formula in data designer - allow date option

Related products:CS Rules Engine
  • May 11, 2021
  • 3 replies
  • 132 views

Right now, you can use case formula for String, Number, and Boolean but it would be great to allow Date.

 

For example, I did a comparison between two date by subtracting them from each other to compare to columns of dates to determine which was the later date. In the next transform, I was to do a case where if DIFF is POSITIVE then select DATE 1 otherwise select DATE 2. This will allow me to do a comparison between two columns of dates

3 replies

Expert ⭐️
May 12, 2021

I would argue this enhancement is still needed.

 

If we had it, the solution would be one task with a case statement. What I proposed with the union will require an additional 3 unions/tasksminimum.

Contributor ⭐️⭐️⭐️
March 22, 2023

Running into the need for this. Upvoting!

jordan_cook
Contributor ⭐️⭐️⭐️⭐️⭐️
March 5, 2025

I just ran into this need the other day. My workaround was to convert dates to strings in one transformation, then do a case statement in a second transformation, and then parse back into a date in the a third transformation. Not pretty.